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

Comments

jasonsavino’s picture

Assigned: Unassigned » jasonsavino
Status: Needs review » Active
odizle’s picture

Issue tags: +drupal 7, +google adwords

hey,
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:


 <!-- Google Code for Leed Conversion Page -->
<script type="text/javascript"></script><script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
<!--//--><![CDATA[// ><!--


//--><!]]>
</script><noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/969411295/?label=U9FiCNnh3gIQ35WgzgM&amp;guid=ON&amp;script=0" /></div>
</noscript>  </div>

instead of this


<!-- Google Code for Leed Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 969411295;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "U9FiCNnh3gIQ35WgzgM";
var google_conversion_value = 0;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/969411295/?label=U9FiCNnh3gIQ35WgzgM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

i also test conversions and nothing was recorded in adwords.
would love some help if you can.

latulipeblanche’s picture

@das-peter

How could I use this module you wrote for D7 on the 'Completion message' checkout pane of Commerce ?

das-peter’s picture

@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

mrfelton’s picture

For 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.

mrfelton’s picture

Status: Active » Needs review
StatusFileSize
new27.26 KB

Here 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?

mrfelton’s picture

To make life easier for now, I've created a sandbox with the D7 branch at http://drupal.org/sandbox/mrfelton/1517042

mrfelton’s picture

A 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.

gomino’s picture

How is the sandbox code working?

Is it ready to use in a production site?

Thanks.

mrfelton’s picture

We are using it in production without issue.

gomino’s picture

Thank you mrfelton, I'll do it too

axon’s picture

for non-programmers - how do I use the sandbox - is this a module? how do I download it?

adamgerthel’s picture

StatusFileSize
new8.35 KB

@axon you'll need to clone it via git, but for your convenience, I've attached a zip.

jasonsavino’s picture

Version: 6.x-1.2-beta1 » 7.x-1.x-dev

A D7 branch has been created. Thank you for the patches and upgrades. I modified some things that I thought needed it.

hyperglide’s picture

Wonderful! When would it show up on the project page?

theneonlobster’s picture

The dev branch seems to be working. The beta should be removed or merged because it appears to be identical to 6.x-1.3

das-peter’s picture

Following 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.

perignon’s picture

Issue summary: View changes
Status: Needs review » Fixed

I 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.

perignon’s picture

Status: Fixed » Closed (fixed)