You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
These are the instructions from Google:
III. Conversion tracking & Hypertext Preprocessor (PHP)
Follow these instructions to insert the conversion tracking code to a website created using dynamically-generated PHP: Hypertext Preprocessor (PHP) pages.
To add conversion tracking code to PHP pages using your web page editor, complete the following tasks:
1. Open your conversion confirmation page PHP file. If multiple pages are generated from the same file, find the section in the PHP file which generates your conversion page.
2. If your site has a variable conversion value, determine the PHP expression that displays that value. For example: <?php echo $totalValue ?>, <? echo totalValue ?>
Choose the Purchase/Sale conversion type while going through the conversion tracking setup. Insert the full string (<? echo $totalValue ?>) into the "Revenue for your action" field and click Save Changes & Get Code to generate the final tracking code. Click 'OK' when you're prompted about using an unrecognized value. Copy and save the resulting code snippet .
3. Insert the conversion tracking code onto the conversion confirmation page. Make sure that the code appears within a static HTML section, not contained within an PHP code section (delineated by <? and ?> markers).
Insert the conversion tracking code snippet directly into the body of the conversion confirmation page. Search for the </body> tag and place the code immediately above it.
If the </body> tag is not located within the static portion of the HTML page, make sure that you add the code snippet so that it appears within the <body> section of the page.
Does anybody here have any experience with implementing this tracking code? I know CCP6 in the UK had a marketing module for this kind of thing so I know its possible. Basically which page do I need to put this code on to track a google adwords conversion?
Offline
I'm looking for a page to put this code. I've read that CCP6 used it in the third party placeholder display include but I believe that was for Google Analytics. This code below is for Google Adwords, ie. if somebody clicks on an add, it will show which add they clicked on, what they searched and if they bought or not. I just need to know which "order confirmation" page this code needs to go on in order to successfully track the conversion.
Any help would be appreciated! Thank you.
<!-- Google Code for Buy Product Conversion Page --> <script type="text/javascript"> <!-- var google_conversion_id = ; var google_conversion_language = ""; var google_conversion_format = ""; var google_conversion_color = "; var google_conversion_label = ""; var google_conversion_value = 0; //--> </script> <script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion//?label=&guid=ON&script=0"/> </div> </noscript>
UPDATE - Scratch that I think I figured it out, will update tomorrow with the results.
Last edited by kreinbrink (02-25-2010 18:17:11)
Offline
Yes actually I did. To get this working properly, you need to paste your google adwords tracking information from your account into a display include. The tracking code should look something like this:
<!-- Google Code for Buy Product Conversion Page --> <script type="text/javascript"> <!-- var google_conversion_id = ###########; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "##############"; var google_conversion_value = 0; //--> </script> <script type="text/javascript" src="################################"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="###########################"/> </div> </noscript>
Go to System -> Display -> Display Includes
Go to Page 2 and update the "Order Summary (Order Confirmation)" include
Go all the way to the bottom of that display include and paste your code that looks like the one above after the closing ?> tag. Make sure it is within <p> </p> tags.
The bottom of the display include should look something like this:
} // End of if statement. ?> <p> <!-- Google Code for Buy Product Conversion Page --> <script type="text/javascript"> <!-- var google_conversion_id = ###########; var google_conversion_language = "en"; var google_conversion_format = "3"; var google_conversion_color = "ffffff"; var google_conversion_label = "##############"; var google_conversion_value = 0; //--> </script> <script type="text/javascript" src="################################"> </script> <noscript> <div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="###########################"/> </div> </noscript> </p>
And you should be set! Let me know if that helped you or not.
Offline
If you also want to track the value of each conversion you can change this line
var google_conversion_value = 0;
to this
var google_conversion_value = <? print $order['order']['ordertotal']; ?>;
Offline
Hi,
What do you put in the fields above where you have put ###################
Regards
Will
Offline
wjr wrote:
Hi,
What do you put in the fields above where you have put ###################
Regards
Will
That will be stuff that's specific to your account. You'll see the values in there when you login to the area where it gives you the tracking code.
Offline
How do you determine the conversion ID?
Offline
Thanks for post. It’s really informative stuff. I really like to read.Hope to learn a lot and have a nice experience here! my best regards guys!
Offline
Does this only work if you're using AdWords, or will it also work for keyword tracking?
Offline