Announcement

Collapse
No announcement yet.

Google Analytics Not Tracking Conversions

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

    Google Analytics Not Tracking Conversions

    We just went live with our miva 9 site and google analytics is not tracking conversions.

    We recently upgraded from Miva 5.5 PR8 to the newest version of Miva 9 and since we went live with the new miva 9 site, we are not seeing transactions being recorded in Google Analytics.

    We are using the suivant readytheme

    Here is the analytics tracking code.

    Code:
    <mvt:miva compresswhitespace="off" />
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
    ga('create', '<mvt:item name="ga_jsencode" param="ga_tracking:google_id_unencoded" />', 'auto');
    <mvt:if expr="l.settings:page:code EQ 'SFNT'">
        ga( 'send', 'pageview', { 'page':'/' } );
    <mvt:elseif expr="l.settings:page:code EQ 'INVC'">
        ga( 'send', 'pageview', { 'page':'/INVC.html' } );
    <mvt:else>
        ga( 'send', 'pageview', { 'page':'/<mvt:item name="ga_jsencode" param="ga_tracking:url_override_unencoded" />' } );
    </mvt:if>
    </script>

    We do have the ga_jsencode, ga_tacking and ga_transaction items assigned to our INVC page.

    INVC page code is this.

    Code:
    <mvt:item name="html_profile" />
    <head>
        <mvt:if expr="NOT ISNULL l.settings:page:title">
            <title>&mvt:page:title;</title>
        <mvt:else>
            <title>&mvt:store:name;: &mvt:page:name;</title>
        </mvt:if>
        <mvt:item name="head" param="head_tag" />
    </head>
    <body id="js-&mvte:page:code;" class="<mvt:eval expr="tolower(l.settings:page:code)" /> single-column">
        <mvt:item name="hdft" param="global_header" />    
        <div class="row hdft-header">
            <mvt:item name="hdft" param="header" />
        </div>
        <div class="row main-content-row">
            <div class="column whole">
                <h4>Thank you for your order. Please keep this confirmation for your records.</h4>
                <p><strong>Order #:</strong> &mvt:order:id;</p>
                <p class="clearfix"><strong>Date:</strong> &mvt:order:date; &mvt:order:time;<a href="&mvte:urls:ORDP:secure_sep;Order_ID=&mvt:order:id;&Order_BillEmail=&mvte:global:order:bill_email;&Order_BillZip=&mvte:global:order:bill_zip;" title="Print Order Confirmation" target="_blank" id="js-print-confirmation" class="button button-mini button-square float-right hide medium-inline-block">Print Order Confirmation</a></p>
                <mvt:item name="messages" />
                <mvt:foreach iterator="item" array="order:items">
                    <mvt:if expr=" 'photo' CIN l.settings:item:name" >
                        <mvt:assign name="l.photo_flag" value=" 'true' " />
                    </mvt:if>
                    <mvt:if expr=" 'selfie' CIN l.settings:item:name" >
                        <mvt:assign name="l.selfie_flag" value=" 'true' " />
                    </mvt:if>
                </mvt:foreach>
                <mvt:if expr="l.photo_flag EQ 'true' OR l.selfie_flag EQ 'true'">
                    <div>
                        <p class="bold blue big">You have ordered an item that includes an Engraved Photo.</p><p class="bold">Please remember to email your photo to <a href="mailto:[email protected]">[email protected]</a>.<br>Thank You!</p>
                    </div>
                </mvt:if>
            </div>
        </div>
        <div class="row main-content-row customer-fields">
            <mvt:item name="order_customer" />
        </div>
        <div class="row bottom-shadow main-content-row order-contents">
            <mvt:item name="order_contents" />
        </div>
        <div class="row">
            <mvt:item name="toolkit" param="subtotalorder|ordersubtotal" />
            <mvt:item name="toolkit" param="orderother|ocount|order:id" />
            <mvt:item name="toolkit" param="math_add|X_subtotal|g.orderother|g.ordersubtotal" />
            <img src="https://shareasale.com/sale.cfm?amount=&mvte:global:X_subtotal;&tracking=&mvt:order:id;&transtype=SALE&merchantID=8232" width="1" height="1">
        </div>
        <div class="row hdft-footer">
            <mvt:item name="hdft" param="footer" />
        </div>
        <mvt:item name="hdft" param="global_footer" />
        <mvt:item name="ga_transaction" />
    </body>
    </html>
    Any help would be appreciated.

    Thanks

    -Nick
    Nick Harkins
    www.loveisarose.com

    #2
    I'd recommend installing Chrome's Google Analytics Debugging Extension - https://chrome.google.com/webstore/d...hjechhna?hl=en

    Install it, activate it, then do a ctrl+shift+i to pull up dev tools. Select the console tab. Then run through your checkout process and place a test order. On the INVC page, check the contents of the console tab. You'll see some output similar to what's in the attached screenshot, but there should be additional data below that which shows the transaction information being passed to Analytics. If you don't see any transaction information, or you're seeing errors in the console tab, that may help to further your troubleshooting.


    ga-ss.jpg
    Last edited by 216justin; 06-05-18, 10:24 AM. Reason: Oops - forgot to attach the Google Analytics debugging screenshot
    Justin Sims
    216digital
    Cleveland Area - Code and Design
    https://216digital.com/

    Comment


      #3
      Okay thank you that will be very helpful.
      Nick Harkins
      www.loveisarose.com

      Comment


        #4
        Yeah it doesn't show any transaction information or console errors. It there somewhere where the transaction code can be edited?
        AnalyticsDeBuggerINVC.png
        Nick Harkins
        www.loveisarose.com

        Comment


          #5
          Is there somewhere where the ga_transaction code can be edited?
          Nick Harkins
          www.loveisarose.com

          Comment


            #6
            I'm not sure that there is unfortunately. Here's what I would recommend:

            First, verify that the <mvt:item name="ga_tracking" /> item is being called on the INVC page prior to the <mvt:item name="ga_transaction" /> item. If you ga_tracking item is in your site's global footer, make sure that on the INVC page, the <mvt:item name="hdft" param="global_footer" /> comes before the ga_transaction item.

            If it does, try unassigning the ga_transaction item from the INVC page and then reassigning it.

            If you're still not seeing the transaction data being transmitted, please view source on the INVC page and post it here. I'll take a look and see if anything jumps out to me.
            Justin Sims
            216digital
            Cleveland Area - Code and Design
            https://216digital.com/

            Comment


              #7
              Originally posted by SidFeyDesigns View Post
              Is there somewhere where the ga_transaction code can be edited?
              It's all located under Utility Settings and you can modify it however you would like.
              Mark Hood
              Vermont Gear

              Comment


                #8
                Here is the source code on a test order I just placed.

                DELETED THE CODE TO REMOVE UNWANTED BACK LINKS. It brings no useful info for others.

                And there is no tab to edit the ga_transaction code.

                There is only a tab to edit the ga_tacking code.

                Thanks
                Last edited by SidFeyDesigns; 06-22-20, 04:14 PM.
                Nick Harkins
                www.loveisarose.com

                Comment


                  #9
                  Hello SidFey Designs.

                  We had a similar problem which our programmers could not figure it out, we thought it might be miva's built in GA module. We had to put in a support ticket with miva, and after a short volley of recommendations back and forth, miva finally updated some code to replace the older GA built in Miva code and then it worked. I would view the source code of the Invoice page after in renders (public side), look for the rendered GA code after the invoice page renders. You should see the complete GA conversion values, but I would guess your missing some tracking variables which is why Analytics is not reporting them. Not sure if you have the same issue, but it sure sounds like it. Good Luck

                  Kevin
                  AutomotiveWorkwear.com

                  Comment


                    #10
                    Yeah I'm not seeing any of the transaction-specific JavaScript in there.

                    In the "Google Analytics Settings" tab, what "mode" is the module currently set to? Can you confirm that the <mvt:item name="ga_transaction" /> is included towards the bottom of main INVC page template? If so, have you tried unassigning the page item and reassigning it to the page?

                    Justin Sims
                    216digital
                    Cleveland Area - Code and Design
                    https://216digital.com/

                    Comment


                      #11
                      Same here.

                      The "mode" is set to "Universal Enhanced Ecommerce (analytics.js)

                      The the <mvt:item name="ga_transaction" /> is right before the closing body tag as you can see on the INVC page code at the top of this thread

                      I did try unassigning and reassigning the item
                      Nick Harkins
                      www.loveisarose.com

                      Comment


                        #12
                        Unfortunately I'm at a loss then. Miva may need to advise on this.
                        Justin Sims
                        216digital
                        Cleveland Area - Code and Design
                        https://216digital.com/

                        Comment


                          #13
                          Yeah that is what I was thinking. I will have to make a support ticket with our host since we do not host with miva.

                          I really appreciate your efforts in trying to help me trouble shoot this.

                          -Nick
                          Nick Harkins
                          www.loveisarose.com

                          Comment


                            #14
                            No worries.
                            Justin Sims
                            216digital
                            Cleveland Area - Code and Design
                            https://216digital.com/

                            Comment


                              #15
                              Nick - feel free to reach out to us if you would like us to take a look.
                              All the best,
                              Sabine Sharp
                              eCommerce Strategies & Solutions
                              Glendale Designs
                              Support Desk
                              623.322.6066

                              Comment

                              Working...
                              X