Setting up Adwords conversion tracking - where paste code-snippet?

Started by JollyGuru, May 12, 2015, 07:54:04 AM

Previous topic - Next topic

JollyGuru

I am trying to set up AdWords 'Conversion tracking' - In other words, a function to see who of those who has clicked my Adwords ads actually completes a registration on my forum.

So now google has given me a code-snippet and says:
'To install, copy the code in the box below and paste it between the <body></body> tags of the page you'd like to track.'.

Where (in what file) would I paste this code-snippet in order to track users who has completed the registration?

margarett

It has to be in index.template.php. Find <body> and somewhere after paste your code (inside an "echo")
Be sure to escape any existing single quotes with a backslash, though. So:
'
becomes
\'
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JollyGuru

Quote from: margarett on May 12, 2015, 08:02:57 AM
It has to be in index.template.php. Find <body> and somewhere after paste your code (inside an "echo")
Be sure to escape any existing single quotes with a backslash, though. So:
'
becomes
\'

Just to make sure I was clear here: This particular code is to be able to track my "goal" of having a person signed up to my forum. So I am guessing the code needs to be on the first page a user reaches after signing up. Well.. I'm a newbie so I'm just making a lot of assumptions here. :-)
But just to make sure, with that being said; is index.template.php still the place to put this code?

margarett

index.template.php is called in *everything* that SMF does. So yes, it should be the correct place, assuming that your code is able to distinguish from a guest and a registered user.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

JollyGuru

Quote from: margarett on May 15, 2015, 06:12:32 PM
index.template.php is called in *everything* that SMF does. So yes, it should be the correct place, assuming that your code is able to distinguish from a guest and a registered user.

Ah but you see, I don't think the code can distinguish a guest from a registered user!
I'm no programmer, but my guess is that the code is only a counter or flag or whatever you could call it. It just notices whenever someone reaches that code and counts it as a "hit".
So my guess is that the code needs to be somewhere within the registration-process - If its going to count only the number of people completing registration.
Again, I'm no expert on this, so I'm fumbling in the dark here.

Anyway this is what the code looks like, if this helps:

"<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1234567;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "aj_ABCDEFGHIJKL";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/4567890/?label=aj_LCNH_ABCDEFGHamp;guid=ON&amp;script=0"/>
</div>
</noscript>

What do you think?

JollyGuru


margarett

I really don't see an easy way to do this, I'm sorry.

Depending on how your registrations are processed, a different flow for SMF is performed.

Anyway, there's a much easier way to know how many people are registered in your forum: at the bottom of your BoardIndex you have to total number of members. That's what you need to check. How to deliver this number to Google? Well, that I honestly don't know :(
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

he could try putting it somewhere in the register.template.php file...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

JollyGuru

Quote from: margarett on May 20, 2015, 09:20:46 AM
I really don't see an easy way to do this, I'm sorry.

Depending on how your registrations are processed, a different flow for SMF is performed.

Anyway, there's a much easier way to know how many people are registered in your forum: at the bottom of your BoardIndex you have to total number of members. That's what you need to check. How to deliver this number to Google? Well, that I honestly don't know :(

Hmm. I think you've missed the point of what I'm trying to do.
What I'm trying to do is to see how many of the people clicking on my Google Adwords Ads actually end up signing up to my forum after clicking on one of my ads.
Here is a short video by google explaining it:
https://support.google.com/adwords/answer/1722054?hl=en-GB
So ideally it the code should go into a "confirmation"-page when a user has actually signed up.

JollyGuru

Quote from: Kindred on May 20, 2015, 09:22:45 AM
he could try putting it somewhere in the register.template.php file...

Perhaps.
I found another thread also mentioning this:
http://www.simplemachines.org/community/index.php?topic=501019.0

Ideally the code should be at a page after the registration is actually completed, in case some people stop the registration-process when reaching the registration page.
But... maybe there is no better place to put the code?

JollyGuru

So lacking knowledge of a better option I will try putting googles code-snippet within  the register.template.php

But do I need to do something with the code (edit it in some way?) or can I just paste it as it is?
(Please, see up above for how the code-snippet)

Advertisement: