GA: How do I preserve custom dimension across domain and subdomain?
-
Using custom dimensions our site tracks logged-in vs not logged-in users on our shop site (shop.example.com). A user can only login on the shop.example.com.
The problem is when the logged in user visits our the main domain (example.com), we lose the custom dimension and the user becomes anonymous. At this point, if the user goes back to shop.example.com, the logged-in custom dimension comes back.
How do I preserve the logged-in user dimension across the main domain?
Example of snippet:
-
Read more about setting up a linker here in Google Analytics: https://developers.google.com/analytics/devguides/collection/analyticsjs/linker this will make sure that you can at least have cross domain tracking.
-
I'm not familiar with "linkers". How do I make sure GA is using linkers? Thanks.
-
Hi,
The logic for a custom dimension can't usually be just passed on. But what you could do is make sure that Google Analytics is using the linkers to connect the shop subdomain to the root of the site. Which will make sure that the cookies for both do overlap and then you can apply the same logic to see if the user is logged in or not.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Big discrepancy between GA an GSC
Hey! I would really appreciate if someone could help me on this 🙂 I have a website with separate mobile and desktop versions, on GSC I see a huge drop in the number of clicks on the mobile website and an increase in the number of clicks on the desktop website, however this isn't reflected at all in GA. GA shows that mobile traffic hasn't increased for any version of the website and the webpages losing traffic according to GSC are flat/growing on GA (even if I look at traffic coming from organic only). Has anyone experienced something similar or has any possible explanation? Thanks!
Reporting & Analytics | | Anna_90 -
Goals tracking across subdomains
Hi all, I'm having some trouble with regards to setting up goals tracking in Analytics across subdomains and was hoping that someone could help me out. Okay I work for an insurance company and we use a Quote & Buy portal for our insurance policies. Our website - www.example.com sends the traffic to quotes.example.com. Both of these sites have the same Google Analytics tracking ID. The quotes.example.com has no duplicate URLs which appear one our website, therefore I only set up the account to only include the hostname for each. Does this sound correct? The goals issue is if I now set up a goal in the quotes.example.com account, someone comes to www.example.com via Google and then clicks through to our journey and completes, will this count as a referral from www.example.com or as a goal from Organic? I'm totally stuck so any help would be appreciated. Thanks Ben
Reporting & Analytics | | Markerstudy0 -
GA profile when migration domains
I'm migrating a .co.uk domain to .com and am trying to decide if I should reuse the same Google Profile (if I can?) or create a new one. If I choose to reuse the same profile so it has historical data, does anyone know if it's just a matter of keeping the same UA profile identifier in place on the page? Or do I have to change anything on the actual profile in GA as well to say "start pulling data from .com now"?
Reporting & Analytics | | Lindsay_D0 -
Ecommerce tracking problem with multiple domains on 1 web property
We recently launched 13 product marketing sites based on a Wordpress Multisite setup. To track all 13 sites we decided to use one web property, so we can use the same tracking code for all domains. To track the sites seperately, we set up a profile for each product site with a hostname filter. This works well for most stats, but eCommerce tracking is where the problem starts. Per profile we obviously want to track the products purchases on that website only. What happens now is that all purchases from all product sites are tracked on all profiles. How can we change this? Should I alter the eCommerce tracking code or can I fix this with an additional filter per profile? Thanks for your help Mozzers! Regards, Pieter van Diggele
Reporting & Analytics | | RBO
Online Marketing Executive
Elsevier Opleidingen0 -
Google analytics for your mobile sub-domain
Hi All, I have just started mobile sub-domain for my desktop site. But I don't to know how to configure analytics for mobile sub-domain. I want to track result between desktop and mobile site. Can any one help me to sort out this problem? Waiting for reply
Reporting & Analytics | | Hexpress0 -
Domain Authority History
Is there a way to check the domain authority of a site from a past date?
Reporting & Analytics | | ClaytonKendall0 -
Tracking 301'd Domains
'ello SEOMozers 🙂 I've been implementing some awesomely search engine friendly 301'd domains for clients and they work great but I seem to have missed the point where I track said domains in some fashion and come here to ask the question --> how are you all tracking refers from 301'd domains that are pointed to your main hubs? Currently our practice in-house is to alias them in our servers then use .htaccess rules to 301 them to the 1 domain to-rule-them-all but Google Analytics doesn't recognize them as different domains with that plan of action and there goes my refer tracking. Is there a super-star way to use the Google URL Builder and combine that with the above plan of action or a better plan? Has anyone else implemented something else more awesome-er that could help a girl out? Much thanks and Happy Thursday!
Reporting & Analytics | | treefrogseo0 -
What's the best way to track moble traffic / sales from a subdomain in Google Analytics?
Hello, I've been trying to figure out the best way to track traffic and sales for a subdomain mobile site and would appreciate any feedback or guidance. I've set up an advanced segment but have found that I'm not able to source traffic since the segments get disabled when trying to view top content pages. I've also setup an additional sub-profile under the main domain profile in google analytics and have set up an advanced filter using the following guildelines http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html In the Profile Settings page, click the Add Filter link. Choose Add New Filter and provide the filter a name. Choose Custom Filter and select Advanced on the Filter type settings. Under Advanced settings: FieldA should be set to Hostname FieldB should be set to Request URI Set the values for both Field A and Field B to (.*), which is an expression that captures all characters. Set the Output To --> Constructor option to Request URI and provide $A1$B1 as the value for that choice. I'm unsure if I've set up the profile / filter correctly, the traffic stats are different than the segment. The mobile profile is also tracking all ecommerce transactions instead of just mobile. Here's the code I have in place. we're using the Traditional code Thanks, Jamie
Reporting & Analytics | | marketing_zoovy.com0