Announcement

Collapse
No announcement yet.

Google Analytics issue since Miva Merchant 9.00061

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Google Analytics issue since Miva Merchant 9.00061

    So, Prior to Miva Merchant 9.00061 Google Analytics say my site like:

    /product/BLW19.html


    Now it see's our site like:

    /http://www.widgetsupply.com/product/BLW19.html

    Our site is completely secure, but Analytics is not seeing it this way. Also, what is with the / prior to the URL? Anyone have any idea's how to fix this?
    Thank you,
    John

    #2
    We introduced the bug you're experiencing in 9.0006. We'll be putting out a fix for this very soon. In the meantime, you can correct this issue by editing your Utility Settings > Google Analytics Tracking Code template. On that tab, click the advanced link to access the template code.

    Find this code near the bottom of the template:

    Code:
    <mvt:if expr="( g.UI_Exception NE 1 ) OR ( g.Session:cache:last_ui_exception EQ 'order_invoice' )">
    ga( 'send', 'pageview', { 'page':'/<mvt:item name="ga_jsencode" param="ga_tracking:url_override_unencoded" />' } );
    </mvt:if>
    ...and change it to the following (replace YOURDOMAINHERE with your domain):
    Code:
    <mvt:if expr="( g.UI_Exception NE 1 ) OR ( g.Session:cache:last_ui_exception EQ 'order_invoice' )">
    <mvt:assign name="g.rr_url" value="glosub( l.settings:ga_tracking:url_override_unencoded, 'http://YOURDOMAINHERE.com', '' )" />
    ga( 'send', 'pageview', { 'page':'&mvte:global:rr_url;' } );
    </mvt:if>
    Notice the fixed code does not contain the prefixed forward slash before the rr_url variable. Regarding your secure issue, there is a field under URI Management, Settings called Secure URL Prefix where you can enter your secure prefix, however I don't believe this will affect your Google report data.

    Regards
    Preston Brynie
    Software Developer
    Miva Merchant
    http://www.mivamerchant.com/

    Comment


      #3
      I don't have that in my tracking code. Mine is:

      <mvt:miva compresswhitespace="off" />
      <script type="text/javascript">
      (function(){
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();

      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '&mvt:ga_tracking:google_id;']);
      _gaq.push(['_trackPageview', '&mvt:ga_tracking:url_override_noquotes;' ]);
      </script>
      Thank you,
      John

      Comment


        #4
        It looks like you're using more than that. See the bottom of your page's source code:

        Code:
         
        <script type="text/javascript">
        (function(){
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-31401543-1']);
        _gaq.push(['_trackPageview', 'http:\/\/www.widgetsupply.com\/product\/BLW19.html' ]);
        </script> <!-- BEGIN: Google Trusted Stores --> <script type="text/javascript"> var gts = gts || []; gts.push(["id", "66915"]); gts.push(["badge_position", "BOTTOM_LEFT"]); gts.push(["locale", "en_US"]); gts.push(["google_base_offer_id", "[BLW19"]); gts.push(["google_base_subaccount_id", "4300607"]); gts.push(["google_base_country", "US"]); gts.push(["google_base_language", "en"]); (function() { var gts = document.createElement("script"); gts.type = "text/javascript"; gts.async = true; gts.src = "https://www.googlecommerce.com/trustedstores/api/js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(gts, s); })(); </script> <!-- END: Google Trusted Stores --> <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"5201518"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script>
        Best,
        Pamela

        Consultant / Developer / Trainer
        Contributing Editor to Practical Ecommerce
        Author of the Official Guides for Miva Merchant
        pamelahazelton.com

        Comment


          #5
          I did a right click select all on the Google Analytics Tracking Code Main Template:

          You have included my Google Trusted Store stuff which I think it is in the Global Footer:

          <!-- BEGIN: Google Trusted Stores --> <script type="text/javascript"> var gts = gts || []; gts.push(["id", "66915"]); gts.push(["badge_position", "BOTTOM_LEFT"]); gts.push(["locale", "en_US"]); gts.push(["google_base_offer_id", "[BLW19"]); gts.push(["google_base_subaccount_id", "4300607"]); gts.push(["google_base_country", "US"]); gts.push(["google_base_language", "en"]); (function() { var gts = document.createElement("script"); gts.type = "text/javascript"; gts.async = true; gts.src = "https://www.googlecommerce.com/trustedstores/api/js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(gts, s); })(); </script> <!-- END: Google Trusted Stores --> <script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"5201518"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n. async=1,n.onload=n.onreadystatechange=function(){v ar s=this.readyState;s&&s!=="loaded"&&s!=="complete"| |(f(),n.onload=n.onreadystatechange=null)},i=d.get ElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document, "script","//bat.bing.com/bat.js","uetq");</script>
          Thank you,
          John

          Comment


            #6
            If you're using the Classic mode, you'll need to use the following code at the bottom of your tracking template:

            Code:
            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', '&mvt:ga_tracking:google_id;']);
            <mvt:assign name="g.rr_url" value="glosub( l.settings:ga_tracking:url_override_noquotes, 'http:\/\/YOURDOMAIN.com', '' )" />
            _gaq.push(['_trackPageview', '&mvt:global:rr_url;' ]);
            </script>
            Preston Brynie
            Software Developer
            Miva Merchant
            http://www.mivamerchant.com/

            Comment


              #7
              That didn't seem to work. Does it take time?
              Thank you,
              John

              Comment


                #8
                Oops. Forgot to change to our name.
                Thank you,
                John

                Comment


                  #9
                  Still not working. Here is a my complete tracking code:


                  <mvt:miva compresswhitespace="off" />
                  <script type="text/javascript">
                  (function(){
                  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                  })();

                  var _gaq = _gaq || [];
                  _gaq.push(['_setAccount', '&mvt:ga_tracking:google_id;']);
                  <mvt:assign name="g.rr_url" value="glosub( l.settings:ga_tracking:url_override_noquotes, 'http:\/\/www.widgetsupply.com', '' )" />
                  _gaq.push(['_trackPageview', '&mvt:global:rr_url;' ]);
                  </script>
                  Last edited by widgetsupply; 08-18-16, 07:22 AM.
                  Thank you,
                  John

                  Comment


                    #10
                    I think I might have gotten it by adding www to widgetsupply.com in my URL in the code.
                    Thank you,
                    John

                    Comment


                      #11
                      Spoke too soon. That fixed if for products and categories, but other pages are still like:
                      /https://www.widgetsupply.com/OCST.html
                      Thank you,
                      John

                      Comment


                        #12
                        Spoke too soon. That fixed if for products and categories, but other pages are still like:
                        /https://www.widgetsupply.com/OCST.html
                        I updated this morning. I made the changes as suggested. also seeing /https:// on secure pages. Ecommerce tracking has also stopped working.
                        Ron Frigon
                        Jedi Webmaster Obi-Ron Kenobi

                        Comment


                          #13
                          Mine is working now. I had to add in our URL with www. Also, Miva added an extra line of code. Here is my code now:

                          ​​​​​​
                          ​​​​​​<mvt:miva compresswhitespace="off" />
                          <script type="text/javascript">
                          (function(){
                          var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                          ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                          var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                          })();

                          var _gaq = _gaq || [];
                          _gaq.push(['_setAccount', '&mvt:ga_tracking:google_id;']);
                          <mvt:assign name="g.rr_url" value="glosub( l.settings:ga_tracking:url_override_noquotes, 'http:\/\/www.widgetsupply.com', '' )" />
                          <mvt:assign name="g.rr_url" value="glosub( g.rr_url, 'https:\/\/www.widgetsupply.com', '' )" />
                          _gaq.push(['_trackPageview', '&mvt:global:rr_url;' ]);
                          </script>


                          Thank you,
                          John

                          Comment


                            #14
                            Note, I am using the classic version.
                            Thank you,
                            John

                            Comment


                              #15
                              You'll need to add an additional glosub for https.

                              Code:
                              var _gaq = _gaq || [];
                              _gaq.push(['_setAccount', '&amp;mvt:ga_tracking:google_id;']);
                              <mvt:assign name="g.rr_url" value="glosub( l.settings:ga_tracking:url_override_noquotes, 'http:\/\/www.widgetsupply.com', '' )" />
                              <mvt:assign name="g.rr_url" value="glosub( l.settings:ga_tracking:url_override_noquotes, 'https:\/\/www.widgetsupply.com', '' )" />
                              _gaq.push(['_trackPageview', '&amp;mvt:global:rr_url;' ]);
                              Preston Brynie
                              Software Developer
                              Miva Merchant
                              http://www.mivamerchant.com/

                              Comment

                              Working...
                              X