Results 1 to 8 of 8
  1. #1
    Join Date
    May 2010
    Location
    Texas
    Posts
    393
    Plugin Contributions
    0

    red flag Google Analytics Conversion Tracking code install

    I know there are some plugins that provide this, but I just want the lowest risk approach which is just to add the Google conversion snippet to the checkout success page.

    The threads I have found about this are all very old. So I would like to double check.

    My understanding is:
    1. create a empty file called jscript_google.php
    2. Paste in Google provided code into jscript_google.php
    3. Save here: /includes/modules/pages/checkout_success/jscript_google.php

    Is this right?

    Is there a way to test this on a live site without actually placing an order?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Google Analytics Conversion Tracking code install

    Quote Originally Posted by split63 View Post
    I know there are some plugins that provide this, but I just want the lowest risk approach which is just to add the Google conversion snippet to the checkout success page.

    The threads I have found about this are all very old. So I would like to double check.

    My understanding is:
    1. create a empty file called jscript_google.php
    2. Paste in Google provided code into jscript_google.php
    3. Save here: /includes/modules/pages/checkout_success/jscript_google.php

    Is this right?
    That's where I'd start.

    Quote Originally Posted by split63 View Post
    Is there a way to test this on a live site without actually placing an order?
    No.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2010
    Location
    Texas
    Posts
    393
    Plugin Contributions
    0

    red flag Re: Google Analytics Conversion Tracking code install

    There have been many transactions since inserting the above, and conversions are showing zero. So apparently I don't have it quite right.

    There is a couple of things that don't quite connect....

    1. The code from Google is javascript. Yet, I'm inserting it in a php file.
    2. Google speaks of inserting the script between body tags, but this .php file only contains the script, nothing else.
    3. How does this file, which I created, get executed?

  4. #4
    Join Date
    May 2010
    Location
    Texas
    Posts
    393
    Plugin Contributions
    0

    Default Re: Google Analytics Conversion Tracking code install

    The next day.....still not working.

    I have now put the conversion snippet into:
    includes/templates/<my_template_name>/templates/tpl_checkout_success_default.php

    I added it to the end of this php file.

    Now waiting to see if this works.

  5. #5
    Join Date
    Mar 2009
    Posts
    73
    Plugin Contributions
    0

    Default Re: Google Analytics Conversion Tracking code install

    Any luck of this working?

  6. #6
    Join Date
    May 2010
    Location
    Texas
    Posts
    393
    Plugin Contributions
    0

    Default Re: Google Analytics Conversion Tracking code install

    No luck....but It appears to be some issue with the google tag (snippet)
    I inserted the tag on a test page...that essentially only has the tag. Google's tag assistant sees the tag, but it never shows up in Google Analytics as a conversion. I have a call scheduled with Google tomorrow...maybe they will have an answer.

  7. #7
    Join Date
    May 2010
    Location
    Texas
    Posts
    393
    Plugin Contributions
    0

    Default Re: Google Analytics Conversion Tracking code install

    Okay, I ran a few tests.
    Creating the file /includes/modules/pages/checkout_success/jscript_google.php is a no go. The reason is that this puts the tag in the <head></head> section. Google Tag manager flags this as an ERROR.

    Placing the conversion tag in the includes/templates/<my_template_name>/templates/tpl_checkout_success_default.php file, does work...
    however, while this is not flagged as an error, Google tag manager reports that the tag is improperly positioned. Google recommends that this tag be placed directly before the </body> tag. By placing the tag at the last line tpl_checkout_success_default.php, the tag ends up roughly in the middle of the checkout_success page.
    Its not an error, so I assume it will still work.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Google Analytics Conversion Tracking code install

    I'm sorry, I recall when the analytics code was first introduced for google it DID work fine to be in the <head>. But, many things have changed over the years, and both Google and Zen Cart want things done differently for it to work. Sorry for glossing over that in my previous reply.

    Yes, if you're going to put it in a template file, it's okay to put it in tpl_checkout_success_default.php

    Or you copy /includes/templates/your_template/common/tpl_main_page.php (or tpl_footer.php) into a NEW directory at /includes/templates/your_template/checkout_success/tpl_main_page.php (or tpl_footer.php) and put your google snippet in the bottom of that file.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Google Adwords Conversion Tracking code help.
    By wondergirl in forum General Questions
    Replies: 39
    Last Post: 16 May 2012, 04:21 PM
  2. How/Where do I install Conversion Tracking Code
    By boy1da in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 Mar 2011, 04:33 PM
  3. google analytics conversion code
    By lieven23 in forum Addon Payment Modules
    Replies: 0
    Last Post: 18 Sep 2008, 09:31 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR