Hi there,
Since there's no D7 port of this module yet, I decided to create one on my own.
The port brings some essential changes in the architecture and there's no update path atm..
Changes:
- The module now uses fields to store it's configuration.
To use the tracking just add a Google Adwords Tracking Field to the entity / bundle you would like to track a content. - To deal with some more advanced scenarios the module integrates now with rules and provides the rules action Set Google Adwords conversion tracking code. This makes it possible to insert conversion tracking independent from entities.
Would be nice to have some feedback on this - or even better to have a D7 beta branch soon.
Cheers,
Peter
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | commerce_google_analytics.zip | 8.35 KB | adamgerthel |
| #6 | 1123584.6-google_adwords-d7-port.patch | 27.26 KB | mrfelton |
| google_adwords.tar_.gz | 2.67 KB | das-peter |
Comments
Comment #1
jasonsavino commentedComment #2
odizle commentedhey,
thanks for sharing this, just what i am looking for. unfortunately i am have not been able to get this to work.
i have added this into my landing page "thank you" page but for some reason when i look at the page source it looks like this:
instead of this
i also test conversions and nothing was recorded in adwords.
would love some help if you can.
Comment #3
latulipeblanche commented@das-peter
How could I use this module you wrote for D7 on the 'Completion message' checkout pane of Commerce ?
Comment #4
das-peter commented@latulipeblanche:
I can't think of a solution without creating your own checkout pane atm.
But maybe this module does already what you're looking for: http://drupal.org/project/commerce_google_analytics
I've found it here: http://www.drupalcommerce.org/contrib
Comment #5
mrfelton commentedFor the record, commerce_google_analytics is for adding Google Commerce tracking - which is different from AdWords conversion tracking, which is what this module is about.
Comment #6
mrfelton commentedHere is the module from the original post verbatim but as a patch. Can we get a D7 branch of the module to work against please?
Comment #7
mrfelton commentedTo make life easier for now, I've created a sandbox with the D7 branch at http://drupal.org/sandbox/mrfelton/1517042
Comment #8
mrfelton commentedA couple of things about this:
1) Im my sandbox I have switched hook_page_build for hook_page_alter which ensure that it's run a little later in the cycle.
2) You can use this on a drupal commerce thank you page by creating a rule that acts on the 'Drupal is initializing' event with a php condition containing:
return arg(0) == 'checkout' && is_numeric(arg(1)) && arg(2) == 'complete';This might not work if you have custom redirects or have customized the checkout process in other ways, but it will work with stock Drupal Commerce.
It would be better if we could use the 'Completing the checkout process' event instead, but this would require reworking things slightly so that the code is inserted properly on the page load after completing the process, ie. the one that loads after completing the checkout. Only way I can think of is setting a temporary cookie.
3) It might be better to use drupal_add_js rather than printing the js in a theme function. A bit like ho I did it in #442930: Support for adwords conversion tracking.
Comment #9
gomino commentedHow is the sandbox code working?
Is it ready to use in a production site?
Thanks.
Comment #10
mrfelton commentedWe are using it in production without issue.
Comment #11
gomino commentedThank you mrfelton, I'll do it too
Comment #12
axon commentedfor non-programmers - how do I use the sandbox - is this a module? how do I download it?
Comment #13
adamgerthel commented@axon you'll need to clone it via git, but for your convenience, I've attached a zip.
Comment #14
jasonsavino commentedA D7 branch has been created. Thank you for the patches and upgrades. I modified some things that I thought needed it.
Comment #15
hyperglide commentedWonderful! When would it show up on the project page?
Comment #16
theneonlobster commentedThe dev branch seems to be working. The beta should be removed or merged because it appears to be identical to 6.x-1.3
Comment #17
das-peter commentedFollowing issue was filed after the D7 branch was created: #1762552: Patch to make D7 version work.
I can only guess that this happened because of a lack of understanding how the D7 version has to be used and quite some work went into the patch to make the module "old school" again. As sad as it is that this "superfluous" effort was made - some of the changes make sense.
Thus I created another patch for the current D7 branch that keeps the new usage but provides better documentation about it and incorporates some of the changes from the "old school" patch: #1762552-17: Patch to make D7 version work.
Could we add the usage documentation from the README.txt to the project page too? This could help to avoid a similar issue.
Comment #18
perignon commentedI am closing this issue since the intent of the original request has been meet. I agree about the documentation and that will be the next thing I tackle after fixing the code related issues in the queue.
Comment #19
perignon commented