Jump to content

Google adwords conversion tracking


aris1234

Recommended Posts

I need to add some code to cubecart which does conversion tracking for my ads on google. All I need to do is add some javascript which is executed when a particular event occurs - in this case, i'd like to add it in after a successful sale via PayPal IPN.

Am I right in thinking that it this code needs to be added in orderSuccess.inc.php in the includes directory?

I tried adding it in with an 'echo' command like this:

echo "

<!-- Google Code for Purchase Conversion Page -->

<script language=\"JavaScript\" type=\"text/javascript\">

<!--

var google_conversion_id = 1234567890;

var google_conversion_language = \"en_GB\";

var google_conversion_format = \"2\";

var google_conversion_color = \"FFFFFF\";

if (1.0) {

  var google_conversion_value = 1.0;

}

var google_conversion_label = \"Purchase\";

//-->

</script>

<script language=\"JavaScript\" src=\"http://www.googleadservices.com/pagead/conversion.js\">

</script>

<noscript>

<img height=1 width=1 border=0 src=\"http://www.googleadservices.com/pagead/conversion/1234567890/?value=1.0&label=Purchase&script=0\">

</noscript>

"

Note, that I escaped all the quotes with a backslash. I added this code just before the "// get exchange rates etc" line.

Basically adding this code made all my sales think they had failed.

Is this the best place and way to add such code?

Thanks.

Link to comment
Share on other sites

Guest gwizard

You need to add it to your skin file, not php.

The one to edit is at skins/YOUR SKIN/styleTemplates/global/index.tpl

Just put the code there at the end, but before the </body> tag.

Link to comment
Share on other sites

I don't wan't to doubt that last response of a seasoned forum member,

and I could be totally wrong here...but:

Isn't that code supposed to go on a 'webgood' page?

Meaning, it should only be accessed AFTER the transaction (conversion) has been completed.

Hence...'conversion tracking'.

I would put that snippet of code on the page that says: 'thank you, your order has been completed'.

If you put it on the index.tpl page, your Adwords stats will show sales everytime someone visits your site!

That would make for one helluva day in your adwords account! :w00t:

Link to comment
Share on other sites

Guest gwizard

Oops, you are correct. :w00t:

I though that were the standart page conversion script.

For purchase conversion you need to put it in skins/YOUR SKIN/styleTemplates/content/confirm.tpl in the successful purchase section. You'll see what I mean once you open that file.

Link to comment
Share on other sites

skins/YOUR SKIN/styleTemplates/content/confirm.tpl

Thanks, I wasn't sure about that location...

so you answered one of my future questions. :w00t:

Link to comment
Share on other sites

  • 7 months later...

Oops, you are correct. :)

I though that were the standart page conversion script.

For purchase conversion you need to put it in skins/YOUR SKIN/styleTemplates/content/confirm.tpl in the successful purchase section. You'll see what I mean once you open that file.

Hi, I am trying to do this as well, does it go in the <affliate tracking section> or?

Let me know, most appreciated!

Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...