Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    In general, using the autoload feature of the jscript_whatever files would avoid any edits to existing files, thus saving you time and effort during an upgrade. There might possibly be some advantage to having the script show up at the bottom of the page source instead of in the head; an expert on Google & javascript would know.

  2. #12
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    Hello, I am using 1.5.1.

    I am not programming savvy and trying to find a good instruction of how and where to add Google conversion tag (code).

    Google says:

    "Install your tag:
    Copy the tag in the box below and paste it between the <body></body> tags of the page you'd like to track. You can then use Google Tag Assistant plugin on Chrome to make sure your tag is correctly placed."

    I see suggestion to paste it to: \includes\templates\MY_Custom_Template\common\tpl_main_page.php>

    1. Is this still correct in 2017?

    2. Is there anything else to do? If yes, is there a link with step by step instruction?

    Thank you for your answer in advance.

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

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    Simplest way, which doesn't affect any other files, is to create a new file:

    /includes/templates/YOUR_TEMPLATE_FOLDERNAME_HERE/jscript/jscript_google_analytics.js

    and paste your google snippet in there.

    All of the /includes/templates/YOUR_TEMPLATE_FOLDERNAME_HERE/jscript/jscript_****.js files will automatically be inserted before the </body> tag.
    .

    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.

  4. #14
    Join Date
    Aug 2005
    Posts
    334
    Plugin Contributions
    0

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    Thank you for reply.

    So, I will create a folder /jscript/ as I do not have one there.

    Where can I borrow good jscript_google_analytics.js file to paste Google snippet?

    Sorry for this silly question.

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

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    Google gives you their javascript snippet, which is all you need to put into the jscript_google_analytics.js 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.

  6. #16
    Join Date
    Jan 2014
    Location
    Florida
    Posts
    39
    Plugin Contributions
    0

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    Will using the my_template/jscript method listed above allow for advanced features such as conversion tracking and enhanced ecommerce or is a full blown module necessary to get the most out of google analytics?

  7. #17
    Join Date
    Apr 2006
    Location
    Midland TX
    Posts
    428
    Plugin Contributions
    0

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    I use Bing ads and Google ads.
    All I want to know is when customer click on Submit Order button is the sale from Bing or Google.
    After reading all of this I am confused. No one mention Bing ads. I find it hard to believe I am the only one using Bing.

    So could someone please tell me in simple details where to paste both of these codes?

  8. #18
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    458
    Plugin Contributions
    1

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    Quote Originally Posted by DrByte View Post
    Simplest way, which doesn't affect any other files, is to create a new file:
    /includes/templates/YOUR_TEMPLATE_FOLDERNAME_HERE/jscript/jscript_google_analytics.js and paste your google snippet in there.
    All of the /includes/templates/YOUR_TEMPLATE_FOLDERNAME_HERE/jscript/jscript_****.js files will automatically be inserted before the </body> tag.
    Hi DrByte,
    I have a new 1.5.7c install using Responsive_Classic.
    I installed my google analytics code as you suggested by creating the jscript_google_analytics.js and adding the code to it in /includes/templates/responsive_classic/jscript/.
    The google analytics wasn't reading the conversions correctly and after speaking with their tech support, they advised me to paste the code in /includes/templates/responsive_classic/common/html_header.php just ABOVE the </head> tag, before line 215.
    After doing so, they advised they can now see it working.

    I asked them if I should remove the google .js file I created but they said to leave it.

    Was their suggestion of where to input the code correct?
    Also, is there really a point of leaving the .js file to run on every page?
    *Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

  9. #19
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,475
    Plugin Contributions
    88

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    Quote Originally Posted by rlexyd View Post
    Hi DrByte,
    I have a new 1.5.7c install using Responsive_Classic.
    I installed my google analytics code as you suggested by creating the jscript_google_analytics.js and adding the code to it in /includes/templates/responsive_classic/jscript/.
    The google analytics wasn't reading the conversions correctly and after speaking with their tech support, they advised me to paste the code in /includes/templates/responsive_classic/common/html_header.php just ABOVE the </head> tag, before line 215.
    After doing so, they advised they can now see it working.

    I asked them if I should remove the google .js file I created but they said to leave it.

    Was their suggestion of where to input the code correct?
    Also, is there really a point of leaving the .js file to run on every page?
    If you've already modified your template's /common/html_header.php to include the Google Analytics code directly, you should delete that .js file since that would cause the analytics to be included twice on each page.

  10. #20
    Join Date
    Oct 2012
    Location
    Philadelphia, PA, USA
    Posts
    34
    Plugin Contributions
    0

    Default Re: How I Added Google Analytics Tracking Code instead of using a plugin

    I, too, have a 1.5.7c site - https://sepialiterature.info.
    I, too, was unable to get analytics working per Dr.Byte's directions. I too added the Google analytics snippet before the /public_html/includes/templates/sepia/common/html_header.php. It now seems to be working. As lat9 suggested, I did delete the snippet from the jscript_google_analytics.js file, too.

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v139h Google Analytics Conversion Tracking code install
    By split63 in forum General Questions
    Replies: 7
    Last Post: 17 Dec 2015, 04:09 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: 6
    Last Post: 3 Oct 2013, 10:36 PM
  4. Ecommerce Tracking code for Google Analytics
    By Endre in forum General Questions
    Replies: 7
    Last Post: 14 Nov 2012, 03:20 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