Analytics & Testing

One Google Analytics Account, Multiple Domains

If you’re a franchise corporation, you might have multiple domains or subdomains but you wish to track traffic across all of them. This is possible by adding another profile within Google Analytics and appending a second profile tracker.

ORIGINAL Code Sample:

<script type="text/javascript">
try {var pageTracker = _gat._getTracker("UA-111111-1");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._initData();
pageTracker._trackPageview();
} catch(err) {}
</script>

NEW: Asynchronous Google Analytics Code Sample:

<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12345-1']);
_gaq.push(['_setDomainName', 'example-petstore.com']);
_gaq.push(['_setAllowLinker', true]);
_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);
})();
//]]>

A few weeks ago I did some digging in Google Analytics and they actually promote the method of adding profiles to filter data as well. Perhaps you want to observe how many people visit your site from within your company versus external visitors. You can add a filter for your IP addresses on one profile (limiting traffic to just the external) and then compare the two accounts.

Douglas Karr

Douglas Karr is CMO of OpenINSIGHTS and the founder of the Martech Zone. Douglas has helped dozens of successful MarTech startups, has assisted in the due diligence of over $5 bil in Martech acquisitions and investments, and continues to assist companies in implementing and automating their sales and marketing strategies. Douglas is an internationally recognized digital transformation and MarTech expert and speaker. Douglas is also a published author of a Dummie's guide and a business leadership book.

Related Articles

Back to top button
Close

Adblock Detected

Martech Zone is able to provide you this content at no cost because we monetize our site through ad revenue, affiliate links, and sponsorships. We would appreciate if you would remove your ad blocker as you view our site.