Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,079
    Plugin Contributions
    22

    Default Google Analytics 2019 gtags

    After using various googleanalytics mods for years, I now find myself cleaning up a lot of crap! I have created a small mod to clean up and use the gtags analytics code.

    But testing needs to be done. The mod is available on github for use and I invite anyone to help with any edits necessary.
    https://github.com/wiztechinc/googleAnalytics/

    All that's needs doing on the template is adding this code to the html_header before the ending head tag:
    PHP Code:
          <?php 
         
    if     (GA_ENABLED == 'True') {
          { 
          
    ?>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo GOOGLE_ANALYTICS_UACCT ?>"></script>
         
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
      gtag('config', '<?php echo GOOGLE_ANALYTICS_UACCT ?>');
    </script>
          <?php }
    ?>
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #2
    Join Date
    Jul 2012
    Posts
    14,805
    Plugin Contributions
    17

    Default Re: Google Analytics 2019 gtags

    Is there a reason why the above code to be added isn't incorporated in at least either of two normal ways of either some form of javascript file or via the notifier?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,079
    Plugin Contributions
    22

    Default Re: Google Analytics 2019 gtags

    This is a simple introduction of only the gtag. I’m not intending anymore than that.
    The full-time Zen Cart Guru. WizTech4ZC.com

 

 

Similar Threads

  1. Google Ads Remarketing in 2019 with dataLayer and ZC 1.5.5
    By neekfenwick in forum General Questions
    Replies: 3
    Last Post: 21 Oct 2019, 05:19 PM
  2. Google Analytics
    By muah in forum General Questions
    Replies: 25
    Last Post: 20 Jun 2009, 08:15 PM
  3. Replies: 1
    Last Post: 14 Jun 2008, 02:06 AM
  4. Google Analytics
    By jrb1512 in forum All Other Contributions/Addons
    Replies: 15
    Last Post: 5 Dec 2006, 03:41 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