WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Google Analytics embed code twice | Wootique (1 post)

  1. cruiseback
    Member
    Posted 1 year ago #

    Hi,

    I am using WooCommerce together with Wootique, and I am getting some weird results.

    Basically, should I input my tracking in both the theme's options page and in WooCommerce's options page, or just one of them?

    I tried removing the tracking code from the theme options, but then the tracking code only appears on the shop pages like cart, checkout etc.

    If I remove it from the WooCommerce option pages, then I don't get access to WooCommerce's built in tracking functions.

    So, what should I do and does it hurt to have the tracking code twice in one page?

    For now, when using both fields, my tracking code looks like this:

    <script type='text/javascript'>
    var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-000-0']);
      _gaq.push(['_trackPageview']);
    
      (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);
      })();
    </script>
    <script type='text/javascript'>
    
    	var _gaq = _gaq || [];
    	_gaq.push(
    		['_setAccount', 'UA-000-0'],
    		['_setCustomVar', 1, 'logged-in', 'no', 1],
    		['_setCustomVar', 2, 'user-id', '', 1],
    		['_setCustomVar', 3, 'username', 'Guest', 1],
    		['_trackPageview']
    );
    
    (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);
    })();
    </script>

    http://wordpress.org/extend/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic