Uploaded image for project: 'Skin Intranet'
  1. Skin Intranet
  2. SKININTRA-102

Google analytics is not working when using tarteaucitron

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 1.1.2, 1.2.0
    • None
    • None
    • None
    • 4.6 M5

      In source code I can see the following code. I think this code should be there when using tarteaucitron

      ametysCookieConsentListener.push(function(accept) {
                          if (accept)
                          {
      		                var gaProperty = 'UA-17360668-6';
      		                
                              var a = document.createElement('script');
                              var m = document.getElementsByTagName('script')[0];
                              a.async = 1;
                              a.src = 'https://www.googletagmanager.com/gtag/js?id=' + gaProperty;
                              m.parentNode.insertBefore(a, m);
           
                              window.dataLayer = window.dataLayer || [];
                              function gtag(){dataLayer.push(arguments);}
                              gtag('js', new Date());
                              gtag('config', gaProperty);
                          }
                          else
                          {
                              // Delete Google Analytics cookies    
                              var cookieNames = ["__utma","__utmb","__utmc","__utmt","__utmv","__utmz","_ga","_gat","_gid"];
                              for (var i=0; i<cookieNames.length; i++)
                              {
                                  $j.removeCookie(cookieNames[i], { path: '/intranet' || '/'});
                              }
                          }
                      }); 

      It should looks like

      <script type="text/javascript"><!--
      	            tarteaucitron.user.gajsUa = 'UA-17360668-6';	        // --></script> 

       

            Unassigned Unassigned
            raphael Raphaël Franchet
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: