Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jun 2006
    Posts
    783
    Plugin Contributions
    0

    Default How do I put a Google tracking code in my checkout-success file?

    I am inputting Google tracking code into my checkout_success.php file. Where is it safe to input this code? In an html file it woud be anywhere before the /Body tag, but I am not sure with PHP.

  2. #2
    Join Date
    Aug 2004
    Posts
    503
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    You need to put the tracking code in your tpl_footer page and if you are using one of the mods that call the code, the call needs to come from tpl_main_page.

    You can create a goal in analytics to track your success once it starts.

    Hope that helps.

    Rick

  3. #3
    Join Date
    Jun 2006
    Posts
    783
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    Thanks, but this doesn't make a lot of sense to me...

  4. #4
    Join Date
    Aug 2004
    Posts
    503
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    I use Simple Google Analytics from the downloads section for my store.
    http://www.zen-cart.com/index.php?ma...roducts_id=412

    It requires an sql patch and then there are two files to add. One file goes in your tpl_main_page and the other goes in your tpl_footer.

    The directions are easy and simple to follow.

    Once installed you can set up goals inside of google analytics to track just about anything you want. I track the checkout success of my store using a goal I setup in google analytics..

    Rick

  5. #5
    Join Date
    Oct 2007
    Posts
    157
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    Quote Originally Posted by disciple View Post
    It requires an sql patch and then there are two files to add. One file goes in your tpl_main_page and the other goes in your tpl_footer.

    The directions are easy and simple to follow.

    Once installed you can set up goals inside of google analytics to track just about anything you want. I track the checkout success of my store using a goal I setup in google analytics..

    Rick
    From my understanding, if you are running version 1.3.X of zen cart, you don't have to past in any code, just upload the included files and install the SQL Patch.

    What did you put into your tpl_main_page and tpl_footer files?

    I want to set up a goal for checkout success, but can't figure out what the URL would be for that.

  6. #6
    Join Date
    Jan 2007
    Posts
    159
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    Are you talking about the Conversion Tracking Code from Google AdWords?

    It looks like everyone is talking about Google Analytics.

    The Conversion Tracking Code needs to go on a Thank You page or Order Confirmation page that follows an order submission.

  7. #7
    Join Date
    Oct 2007
    Posts
    157
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    Quote Originally Posted by Tech-E View Post
    Are you talking about the Conversion Tracking Code from Google AdWords?

    It looks like everyone is talking about Google Analytics.

    The Conversion Tracking Code needs to go on a Thank You page or Order Confirmation page that follows an order submission.
    I'm talking about google analytics as well.

    I want to set up a "conversion goal" for when someone makes a purchase--to set up a conversion goal, you are supposed to put in a URL for the page--but I don't know what they URL would be.

  8. #8
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    347
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    I want to add this code as well. It is not the analytics code, I already have that which goes in the footer.

    The code kevinmc3 is talking about is also available from google adwords (if you have an account) and is used to track the conversion rate between visits and purchases as well as which product sells the best etc...

    It needs to go into the checkout_success page ( or a page the buyer gets to after completing their purchase).

    The code is in HTML and we also need to include the following functions:
    "Next, somewhere in the receipt below the tracking code, call the _addTrans() and _addItem() functions. Begin with a call to _addTrans() to establish a transaction. _addTrans() takes the following arguments: Order ID,Affiliation, Total, Tax, Shipping, City, State, Country. For each item that the visitor purchases, call _addItem(). _addItem() takes the following arguments: Order ID, SKU or Code, Product Name, Category, Price, Quantity.

    Here is a complete example:

    <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>

    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-XXXXX-1");
    pageTracker._initData();
    pageTracker._trackPageview();

    pageTracker._addTrans(
    "1234", // Order ID
    "Mountain View", // Affiliation
    "11.99", // Total
    "1.29", // Tax
    "5", // Shipping
    "San Jose", // City
    "California", // State
    "USA" // Country
    );

    pageTracker._addItem(
    "1234", // Order ID
    "DD44", // SKU
    "T-Shirt", // Product Name
    "Green Medium", // Category
    "11.99", // Price
    "1" // Quantity
    );

    pageTracker._trackTrans();
    </script>"

    The above in quotes is from the code instructions on the google adwords page for my account.

    If anyone has done this before and can give me an idea of how to go about it, that would be greatly appreciated.

    Thank you.

  9. #9
    Join Date
    Jun 2006
    Posts
    783
    Plugin Contributions
    0

    Default Re: How do I put a Google tracking code in my checkout-success file?

    It requires an sql patch and then there are two files to add. One file goes in your tpl_main_page and the other goes in your tpl_footer.

    The directions are easy and simple to follow.

    Once installed you can set up goals inside of google analytics to track just about anything you want. I track the checkout success of my store using a goal I setup in google analytics..

    Rick[/QUOTE]

    You say anything you want. But, what if I want to track visits to the Home Page? Would this require another file or patch?

    Same for sign up oage. However, if using a 3rd party email service like Constant Contact, the code would have to go into the Constant Contact Thak You for Siging up page.

  10. #10
    Join Date
    May 2006
    Location
    Montana
    Posts
    291
    Plugin Contributions
    20

    Default Re: How do I put a Google tracking code in my checkout-success file?

    I took my adwords code from google, created a file called jscript_adwords.php and put that file under the includes/modules/pages/checkout_success folder.

    Hope this helps someone who is wanting to know where to put ADWORDS javascript - not the google analytics.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 22
    Last Post: 20 Sep 2021, 02:38 AM
  2. Where to put google analytics tracking code???
    By cmike in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 23 Apr 2014, 08:05 AM
  3. Replies: 5
    Last Post: 23 Feb 2010, 01:21 PM
  4. Sales tracking code for checkout success, please help!
    By boinkit in forum General Questions
    Replies: 0
    Last Post: 6 Mar 2008, 06:08 PM
  5. how to put 'recommend this site' on checkout success page
    By OneWorldStudios in forum General Questions
    Replies: 6
    Last Post: 29 May 2007, 06:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg