Announcement

Collapse
No announcement yet.

Does URI Mgmt change Google Analytic page links

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

    Does URI Mgmt change Google Analytic page links

    I just updated my site to a Ready Theme and enabled the URI management. I notice that the Google analytics module is no longer using (tracking) the short-links (/bask.html) but is now using the long links (/mm5/merchant.mvc?Store_Code=ACS&Screen=BASK) . Is this due to the URI management or something else? The URI is still set to /BASK.html in the new URI Mgmt. My Google Analytics code has not changed. Any ideas?

    Thanks
    Highly caffeinated
    http://www.coffeehouseexpress.com

    #2
    Re: Does URI Mgmt change Google Analytic page links

    Have you enabled 'Short Links' under Legacy SEO Settings in URI Management?
    Last edited by doakh; 10-19-15, 09:30 AM.
    Doak Heggeness
    Web Developer | Certified Miva Merchant Developer

    Comment


      #3
      Re: Does URI Mgmt change Google Analytic page links

      Hi Doak - well originally when I enabled URI management I turned off "Enable SEO-Friendly Store Front" and 'Short Links' in the Legacy SEO settings. But since I am having this problem, I turned the "short links" back on but it makes no difference.
      Highly caffeinated
      http://www.coffeehouseexpress.com

      Comment


        #4
        Re: Does URI Mgmt change Google Analytic page links

        Here is what I ended up with to fix the issue in my instance. I don't really know why the short links are no longer being pulled by the Miva Google Analytics module. I'm posting this in case anyone else runs into this problem. You might have to modify the link structure for your link style:
        Code:
        <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:ga_tracking:google_id;', 'auto'); 
        <mvt:if expr="(g.screen EQ 'SRCH')">
        ga('send', 'pageview', '/SRCH.html?Search=&mvta:global:Search;');
        <mvt:elseif expr="(g.Screen EQ 'CTGY')">
        ga('send', 'pageview', '/c/&mvt:global:category_code;.html');
        <mvt:elseif expr="(g.Screen EQ 'PROD')">
        ga('send', 'pageview', '/p/&mvt:global:product_code;.html');
        <mvt:else>
        ga('send', 'pageview', '/&mvt:global:screen;.html'); 
        </mvt:if>
        ga('require', 'ecommerce', 'ecommerce.js'); 
        </script>
        Highly caffeinated
        http://www.coffeehouseexpress.com

        Comment


          #5
          Re: Does URI Mgmt change Google Analytic page links

          Originally posted by Jim Cockerham View Post
          Here is what I ended up with to fix the issue in my instance. I don't really know why the short links are no longer being pulled by the Miva Google Analytics module. I'm posting this in case anyone else runs into this problem. You might have to modify the link structure for your link style:
          Code:
          <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:ga_tracking:google_id;', 'auto'); 
          <mvt:if expr="(g.screen EQ 'SRCH')">
          ga('send', 'pageview', '/SRCH.html?Search=&mvta:global:Search;');
          <mvt:elseif expr="(g.Screen EQ 'CTGY')">
          ga('send', 'pageview', '/c/&mvt:global:category_code;.html');
          <mvt:elseif expr="(g.Screen EQ 'PROD')">
          ga('send', 'pageview', '/p/&mvt:global:product_code;.html');
          <mvt:else>
          ga('send', 'pageview', '/&mvt:global:screen;.html'); 
          </mvt:if>
          ga('require', 'ecommerce', 'ecommerce.js'); 
          </script>

          Having the same problem, except my google analytics tracking code page looks very different:

          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', 'UA-4048301-1', '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', { 'page':'/<mvt:item name="ga_jsencode" param="ga_tracking:url_override_unencoded" />' } );
          
          
          </script>

          Comment

          Working...
          X