Currently our main website is served without SSL at http://example.com
. Our shop is served on a subdomain via at https://store.example.com
.
Our main site uses the traditional Google Analytics code:
var _gaq = _gaq || [];
_gaq.push(
['_setAccount', 'UA-XXXXXX-X'],
['_setDomainName', 'www.example.com'],
['_trackPageview'],
['hq._setAccount', 'UA-XXXXXX-X'],
['hq._setDomainName', 'www.example.com'],
['hq._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);
Our shop at uses the new Universal Analytics:
ga('create', 'UA-XXXXXX-X', 'auto', { 'allowLinker': true });
// Load the plugin.
ga('require', 'linker');
// Define which domains to autoLink.
ga('linker:autoLink', ['store.example.com']);
ga('send', 'pageview');
- Should both the main site URL and the store subdomain's URL be included in the
ga('linker:autolink', []);
line? - Does the linker section need to be added to the main websites URL code?
Currently all metrics for both sites are showing up under our main websites Google Analytics account, including visits, pageviews, etc. to our shop's URL, which is fine and how we want it to be.
- Would like to create a new/separate view where we only see traffic to the store's subdomain. I've created the new view in the account, but I'm not getting any data back at all. How do I need to set up the view to in the settings (such as "Website's URL": We added
https://store.example.com
here) or do we need to work with filters?