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
-
Help me exclude our dynamic IP addresses from GA
Hi There, I can't believe we are the first SEO Web Development company with the issue of dynamic IP addresses, for technical reasons our ISP keeps changing our IP addresses to different random IP addresses (no patterns, ranges, or reasoning to the specific changes) and we obviously need to exclude our own visits to google analytics - but I can't seem to find any simple way to do this in Google Analytics - can you help me find a simple solution for this? I did find two chrome extensions(I'll give you the links to those at the end) that I will look into if you cant help me find a simpler solution 🙂 Thanks so much!! https://chrome.google.com/webstore/detail/block-yourself-from-analy/fadgflmigmogfionelcpalhohefbnehm?hl=en https://chrome.google.com/webstore/detail/developer-cookie/lknhpplgahpbindnnocglcjonpahfikn
Reporting & Analytics | | Ruchy1 -
Google Analytics Goals - Different Domain
Hi, We currently need to setup a goal that involves a different domain. Any guidance would be greatly appreciated. more info: the checkout process is redirected to a secure.domain Just let me know if I can provide any additional info that may helpful.
Reporting & Analytics | | opusvo0 -
IP address changed, subdomains added - how will affect?
Hello, Two weeks ago we have changed IP address of our website, also we've added new subdomains for static content (like img.domain.com & js.domain.com) and changed the links on the site accordingly. The old IP is also working and the old links are accessible too. For some reason, since the change, we see a SE (google) traffic constant drop everyday. I've read only Google's support (http://support.google.com/webmasters/bin/answer.py?hl=en&answer=34437) that such change shouldn't affect the ranking anyhow. On the other hand I've consulted with SEO people and was told that such change may affect in the close new feature (for couple of weeks) and then bring the ranking back. I would like to hear another opinion, I want to get back to our board with approved answers. Please advice. Thanks.
Reporting & Analytics | | maddogx0 -
Is there a way to calculate Domain Authority and Domain Trust on a large scale?
Hi there! Since on of our websites is hit by the Penguin update I'm trying to find spammy and low quality external links from our domain. I'm using Xenu to get all the external links. Now I want to know about the quality of the external websites our domain links to. Is there a way to calculate domain authority and domain trust on a large scale in Excel or Google spreadsheet? Kind regards, Mark
Reporting & Analytics | | StephWeigert0 -
Is Analytics Code for SubDomains different?
I am currently tracking site performance on our website with Google Analytics. Recently, we've brought a Wordpress blog into our site as a subdomain blog.accupos.com. Though we did this a few months ago, we do not have Analytics data for these pages within the wordpress platform. I've found where to paste the code, in the Footer block of the Wordpress template, just before the close body tag (is this the best recommended way?) and just have one question about WHICH code to paste. Can I add the original code, same as the rest of the site? Or does Analytics have a different code for tracking subdomains? If so, do I need to replace existing code for the rest of the site? I hope I worded this okay. Please help. I'd appreciate it! Derek M.
Reporting & Analytics | | DerekM880 -
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 -
Why does this domain never pass 150 organic visits from Google?
Hello, The domain http://bit.ly/fwTEsT has been out there for one year, it has about half million indexed pages. We made a lot of changes that could affect SEO and I don't know if Google likes it but the one thing it's sure is that in one whole year the organic visits from Google never got pass 150 visits per day. We've got about 2000 PPC visits but organic don't go up. I'd like to know what our main errors would be so we can focus more on fixing them. Thank you, Alexandru.
Reporting & Analytics | | elwebmaster0 -
How to export all my keywords from GA new version
Hi I want to know how can i download all my keywords within the kw report of the google analytics new version. It seems to me that the "limit=50000" parameter doesn't work on this new version. If that is true how can i do to export all my keywords let say on CSV format? Thanks a lot
Reporting & Analytics | | FranckNlemba0