Google Product Forums

traditional vs asynchronous with eCommerce and sub-domain


vitaminn 2012/04/09 16:40
グループへの投稿: Google Analytics

カテゴリ: Feedback/Suggestions : Asynchronous Tracking Code Snippet :

Hello,  I have an eCommerce website which also has a sub-domain.  (news.mydomain.com)

The website currently has the asynchronous tracking code for "one domain with multiple sub-domains" and i have selected "AdWords campaigns" .  Currently, the tracking code looks like this:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-########-1']);
  _gaq.push(['_setDomainName', 'mydomain.com']);
  _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>

With the above traditional code installed, eCommerce transactions are not being tracked.

The eCommerce platform i use suggests that I need to use the "traditional" code in order to track eCommerce within Analytics...is this accurate?

If it IS accurate, how do i setup the "traditional" code for "one domain with multiple sub-domains" and also tracking "AdWords campaigns" .

Thanks!