Announcement

Collapse
No announcement yet.

Google Analytics Goals

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

    Google Analytics Goals

    Hi all,

    I have miva 9 and google analytics set up for my store and am receiving data in google analytics. I am not receiving goal tracking.

    - in miva 9 I have universal enhanced ecommere (analytics.js) selected in settings.
    - the tracking code is generated by miva 9 appears at the bottom of each of my pages in the body:
    <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');

    ga( 'send', 'pageview' );

    </script>

    - the following code appears in the head:- under ecommerce set-up in google analytics I have enable commerce ON and enhanced ecommere settings ON.

    If everything is set up above correctly, do I set up do I set up a new goal as follows?

    destination equals /INVC.html

    funnel:

    BASK.html
    OINF.html
    OSEL.html
    OPAY.html

    I have looked on the Miva website and was unable to find any documentation on the Miva 9 google analytics settings module.

    thanks!

    #2
    Re: Google Analytics Goals

    this appears to be the latest miva documentation on google analytics and it is outdated:
    http://www.miva.com/videos/store_own...ogle-analytics

    Comment


      #3
      Re: Google Analytics Goals

      I have also tried setting the goal in google analytics to:
      /mm5/merchant.mvc?screen=INVC

      Comment


        #4
        Re: Google Analytics Goals

        Originally posted by leroymiller View Post
        Hi all,

        I have miva 9 and google analytics set up for my store and am receiving data in google analytics. I am not receiving goal tracking.

        - in miva 9 I have universal enhanced ecommere (analytics.js) selected in settings.
        - the tracking code is generated by miva 9 appears at the bottom of each of my pages in the body:
        <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');

        ga( 'send', 'pageview' );

        </script>

        - the following code appears in the head:- under ecommerce set-up in google analytics I have enable commerce ON and enhanced ecommere settings ON.

        If everything is set up above correctly, do I set up do I set up a new goal as follows?

        destination equals /INVC.html

        funnel:

        BASK.html
        OINF.html
        OSEL.html
        OPAY.html

        I have looked on the Miva website and was unable to find any documentation on the Miva 9 google analytics settings module.

        thanks!
        If you are using Universal Enhance Ecommerce

        This is the code that should be in the Google Analytics Tracking Code > Advanced Mode

        <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');


        var mvga_basketitems = [
        <mvt:foreach iterator="item" array="basket:items">
        <mvt:if expr="l.pos1 GT 1">,</mvt:if>
        {
        'code' : '<mvt:item name="ga_jsencode" param="item:code" />',
        'name' : '<mvt:item name="ga_jsencode" param="item:name" />',
        'line_id' : <mvt:eval expr="int( l.settings:item:line_id )" />,
        'group_id' : <mvt:eval expr="int( l.settings:item:group_id )" />,
        'price' : <mvt:eval expr="l.settings:item:price ROUND 2" />,
        'quantity' : <mvt:eval expr="int( l.settings:item:quantity )" />
        }
        </mvt:foreach>
        ];


        var mvga_orderitems = [
        <mvt:foreach iterator="item" array="order:items">
        <mvt:if expr="l.pos1 GT 1">,</mvt:if>
        {
        'order_id' : <mvt:eval expr="int( l.settings:item:order_id )" />,
        'code' : '<mvt:item name="ga_jsencode" param="item:code" />',
        'name' : '<mvt:item name="ga_jsencode" param="item:name" />',
        'price' : <mvt:eval expr="l.settings:item:price ROUND 2" />,
        'quantity' : <mvt:eval expr="int( l.settings:item:quantity )" />
        }
        </mvt:foreach>
        ];


        var mvga_productlist = [];


        var mvga_tracker = new MVGA_Tracker( '<mvt:item name="ga_jsencode" param="ga_tracking:product_link_prefix" />', '<mvt:item name="ga_jsencode" param="category:name" />', '<mvt:item name="ga_jsencode" param="product:code" />', '<mvt:item name="ga_jsencode" param="product:name" />', mvga_basketitems, mvga_orderitems );


        <mvt:if expr="l.settings:page:code EQ 'PROD'">
        ga( 'require', 'ec' );


        <mvt:foreach iterator="list_product" array="ga_tracking:product_list">
        ga( 'ec:addImpression',
        {
        'id' : '<mvt:item name="ga_jsencode" param="list_product:code" />',
        'name' : '<mvt:item name="ga_jsencode" param="list_product:name" />',
        'list' : 'Related Products',
        'position' : '<mvt:eval expr="int( l.settings:list_product:disp_order )" />'
        } );


        mvga_productlist.push(
        {
        'code' : '<mvt:item name="ga_jsencode" param="list_product:code" />',
        'name' : '<mvt:item name="ga_jsencode" param="list_product:name" />',
        'position' : '<mvt:eval expr="int( l.settings:list_product:disp_order )" />'
        } );
        </mvt:foreach>


        ga( 'ec:addProduct',
        {
        'id' : '<mvt:item name="ga_jsencode" param="product:code" />',
        'name' : '<mvt:item name="ga_jsencode" param="product:name" />',
        'category' : '<mvt:item name="ga_jsencode" param="category:name" />'
        } );


        ga( 'ec:setAction', 'detail' );
        <mvt:elseif expr="l.settings:page:code EQ 'CTGY' OR
        l.settings:page:code EQ 'PLST' OR
        l.settings:page:code EQ 'SRCH'">
        ga( 'require', 'ec' );


        <mvt:foreach iterator="list_product" array="ga_tracking:product_list">
        ga( 'ec:addImpression',
        {
        'id' : '<mvt:item name="ga_jsencode" param="list_product:code" />',
        'name' : '<mvt:item name="ga_jsencode" param="list_product:name" />',
        'category' : '<mvt:item name="ga_jsencode" param="category:name" />',
        'list' : '<mvt:item name="ga_jsencode" param="ga_tracking:list_label" />',
        'position' : '<mvt:eval expr="int( l.settings:list_product:disp_order )" />'
        } );


        mvga_productlist.push(
        {
        'code' : '<mvt:item name="ga_jsencode" param="list_product:code" />',
        'name' : '<mvt:item name="ga_jsencode" param="list_product:name" />',
        'position' : '<mvt:eval expr="int( l.settings:list_product:disp_order )" />'
        } );
        </mvt:foreach>
        <mvt:elseif expr="l.settings:page:code EQ 'OSEL'">
        ga( 'require', 'ec' );


        var i;


        for ( i = 0; i < mvga_basketitems.length; i++ )
        {
        ga( 'ec:addProduct',
        {
        'id' : mvga_basketitems[ i ].code,
        'name' : mvga_basketitems[ i ].name,
        'quantity' : mvga_basketitems[ i ].quantity
        } );
        }


        ga( 'ec:setAction', 'checkout', { 'step' : 1 } );
        <mvt:elseif expr="l.settings:page:code EQ 'OPAY'">
        ga( 'require', 'ec' );


        var i;


        for ( i = 0; i < mvga_basketitems.length; i++ )
        {
        ga( 'ec:addProduct',
        {
        'id' : mvga_basketitems[ i ].code,
        'name' : mvga_basketitems[ i ].name,
        'price' : mvga_basketitems[ i ].name,
        'quantity' : mvga_basketitems[ i ].quantity
        } );
        }


        ga( 'ec:setAction', 'checkout', { 'step' : 2 } );
        <mvt:elseif expr="l.settings:page:code EQ 'INVC'">
        ga( 'require', 'ec' );


        <mvt:foreach iterator="ga_orderitem" array="ga_tracking:orderitems">
        ga( 'ec:addProduct', {
        'id' : '<mvt:item name="ga_jsencode" param="ga_orderitem:code_unencoded" />',
        'name' : '<mvt:item name="ga_jsencode" param="ga_orderitem:name_unencoded" />',
        'price' : '<mvt:item name="ga_jsencode" param="ga_orderitem:price" />',
        'variant' : '<mvt:item name="ga_jsencode" param="ga_orderitem:variant_label_unencoded" />',
        'quantity' : '<mvt:eval expr="l.settings:ga_orderitem:quantity" />'
        } );
        </mvt:foreach>


        ga( 'ec:setAction', 'purchase', {
        'id' : '<mvt:eval expr="int( l.settings:ga_orderitem:order_id )" />',
        'revenue' : '<mvt:item name="ga_jsencode" param="ga_tracking:order_total" />',
        'affiliation' : '<mvt:item name="ga_jsencode" param="store:name" />',
        'tax' : '<mvt:item name="ga_jsencode" param="ga_tracking:total_tax" />',
        'shipping' : '<mvt:item name="ga_jsencode" param="ga_tracking:total_ship" />'
        } );
        </mvt:if>
        ga( 'send', 'pageview' );


        </script>
        Happie Mendenhall
        Support Technician
        Miva, Inc.

        Comment


          #5
          Re: Google Analytics Goals

          Thanks Happie!

          Should I copy and paste all of that code (replacing what is in the Google Analytics Tracking Code now)? See screenshot
          Attached Files

          Comment


            #6
            Re: Google Analytics Goals

            Yes

            Go ahead and replace the code from the screenshot with the code I sent you.

            Please and Thank You
            Happie Mendenhall
            Support Technician
            Miva, Inc.

            Comment


              #7
              Re: Google Analytics Goals

              Thank you Happie.

              There is some additional code in the head of the page that seems to refer to google analytics as it refers to mvga.js. Should I delete it or keep it?

              <script type="text/javascript" src="http://www.internationalbusinessstrategies.com/mm5/clientside.mvc?T=48320f43&Module_Code=mvga&amp;Fil ename=mvga.js"></script>

              Comment


                #8
                Re: Google Analytics Goals

                Google analytics funnel is not yet working. The following is in the head tag. Should I remove it?

                <script type="text/javascript" src="http://www.internationalbusinessstrategies.com/mm5/clientside.mvc?T=48320f43&Module_Code=mvga&amp;Fil ename=mvga.js"></script>

                Comment


                  #9
                  Re: Google Analytics Goals

                  Happie, please let me know if the code below should be in the head tag:


                  <script type="text/javascript" src="http://www.internationalbusinessstrategies.com/mm5/clientside.mvc?T=48320f43&Module_Code=mvga&amp;Fil ename=mvga.js"></script>

                  Comment


                    #10
                    Re: Google Analytics Goals

                    I removed this code from the head tag and it didn' seem to break anything. Google Analytics is still working in any case:

                    <script type="text/javascript" src="http://www.internationalbusinessstrategies.com/mm5/clientside.mvc?T=48320f43&Module_Code=mvga&amp;Fil ename=mvga.js"></script>

                    But I still cannot get the google analytics funnel to work. I found the following code in
                    https://support.miva.com/supportsuite/index.php?/Knowledgebase/Article/View/1283

                    Where do I need to add the following or will this help at all?

                    <mvt:if expr="(l.settings:page:code EQ 'BASK') OR (l.settings:page:code EQ 'ORDL')OR (l.settings:page:code EQ 'OCST') OR (l.settings:page:code EQ 'OSEL') OR (l.settings:page:code EQ 'OPAY') OR (l.settings:page:code EQ 'INVC')">
                    ga( 'send', 'pageview', '&mvta:page:code;' );
                    <mvt:else>
                    ga( 'send', 'pageview' );
                    </mvt:if>

                    Comment


                      #11
                      Re: Google Analytics Goals

                      I tried adding this at the end of the google tracking code in miva 9 admin just before the end at </script> but that does still not activate the funnel:

                      <mvt:if expr="(l.settings:page:code EQ 'BASK') OR (l.settings:page:code EQ 'ORDL')OR (l.settings:page:code EQ 'OCST') OR (l.settings:page:code EQ 'OSEL') OR (l.settings:page:code EQ 'OPAY') OR (l.settings:page:code EQ 'INVC')"> ga( 'send', 'pageview', '&mvta:page:code;' );<mvt:else> ga( 'send', 'pageview' );</mvt:if>
                      Last edited by leroymiller; 04-08-15, 06:24 PM.

                      Comment


                        #12
                        Re: Google Analytics Goals

                        I had to reactivate the following code in the head tag content as google analytics stopped working entirely when I commented it out:

                        <script type="text/javascript" src="http://www.internationalbusinessstrategies.com/mm5/clientside.mvc?T=48320f43&Module_Code=mvga&amp;Fil ename=mvga.js"></script>

                        Comment


                          #13
                          Re: Google Analytics Goals

                          Originally posted by leroymiller View Post
                          I tried adding this at the end of the google tracking code in miva 9 admin just before the end at </script> but that does still not activate the funnel:

                          <mvt:if expr="(l.settings:page:code EQ 'BASK') OR (l.settings:page:code EQ 'ORDL')OR (l.settings:page:code EQ 'OCST') OR (l.settings:page:code EQ 'OSEL') OR (l.settings:page:code EQ 'OPAY') OR (l.settings:page:code EQ 'INVC')"> ga( 'send', 'pageview', '&mvta:page:code;' );<mvt:else> ga( 'send', 'pageview' );</mvt:if>

                          You would add that code before the closing script tag below the last closing if statement.
                          Happie Mendenhall
                          Support Technician
                          Miva, Inc.

                          Comment

                          Working...
                          X