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
-
Do custom tracking codes affect indexing?
Hello, My company uses a tracking system that allows our employees to apply a short code snippet to the end of our URLs for marketing attribution. An example of such a code would be: https://www.schoolofmotion.com/?ref_id=moz-test However, in Google Analytics we are seeing duplicates of our content, where the pages with the individual tracking codes are counted separately from the pages without. From a reporting perspective, this is annoying and definitely worth a fix. However, I'm curious if this problem is affecting our search potential as well. Could this tracking system be splitting traffic in Google's eyes? From an SEO perspective, how should we approach this? Would canonical tags fix this duplication issue in Google Analytics? Is there something else that we should use? Thanks in advance. The Moz community is incredible.
Reporting & Analytics | | CalebWardSoM1 -
Creating Goals in GA
Hi I don't know if the below can be done, and I can't seem to find an answer anywhere. Ideally I want to capture the event of registering for an account. Ultimately I want to know which products, pages etc drive customer registrations but which do not lead to a purchase (Registered Not Bought). Does anyone know if this is possible? Thanks Andy
Reporting & Analytics | | Andy-Halliday0 -
URLS are top keywords in GA?
Hey Moz, For some reason on my father's website, michaelpadway.com, the top 2 keywords from organic are complete urls from his site. This doesn't makeugh sense to me. Any ideas?
Reporting & Analytics | | MarloSchneider1 -
Cross Domain Tracking in GA (without cross domain links)
Hi everyone, Been doing some research about cross-domain tracking in Google Analytics (preferably Universal Analytics where documentation is a bit spare). All of the tutorials focus on the auto-linking and ensuring links to the other site are taken care of. I'm considering a site that may not cross-link like that at all (or it may, but won't be the main avenue). A good example is: www.gap.com
Reporting & Analytics | | ketanmv
www.bananarepublic.com
www.oldnavy.com Now, they do link to the other brands in their navigation but let's pretend that they don't necessarily do that. Gap Corporate may want to roll up all these domains into a single reporting profile because customers can clearly visit any of those sites on their own and buy. It would be nice to know that Visitor X bought 2 items from gap.com and 3 from oldnavy.com... and of course, here were their campaigns, etc. From what I am reading, I am not sure this is really possible. It seems that the cross-domain code is really only best for when my main site links to another domain for checkout or something. But in my example, we are definitely not in control of that kind of behavior. Thoughts? Perhaps I need to recommend they go with subdomains only which Universal GA seems to handle quite fine out of the box. Thank you!0 -
Multiple-Domain tracking for sister sites- NO retail checkout- Please help
Hello, I have about 5 sites I want to set up multiple-domain tracking in google analytics. All posts I read seem to be focused on cross-domain tracking for the purpose of tracking a visitor from one domain across another domain for shopping cart check outs. I don't need that. I have about 3 sister sites (mastersite.com, sistersite1.com, sistersite2.com, sistersite3.com) related to my primary site. I want 1 Master Analytics Profile to track traffic for all of these sites combined. My visitors will not jump from mastersite.com over to sistersite1.com. There will be no cross-domain visits. How can I set up 1 master google analytics profile that will aggregate traffic data from all sites and present the data to me in one analytics profile. Please help
Reporting & Analytics | | AndreGant0 -
Tracking on Analytics .ca domain When Redirect From GoDaddy Control Panel?
I bought all .ca, .net, .org, .info and http://www.pilatesboisfranc.com at GoDaddy. I'm using .com and all others are redirect to the .com from the GoDaddy control panel. Is it easy to track any of thems on Analytics? I just installed the tracking code and I selected in the ''What are you tracking'' option from the ''Advance'' tab, '' Multiple top-level domains
Reporting & Analytics | | BigBlaze205
Examples: www.pilatesboisfranc.uk
www.pilatesboisfranc.cn
www.pilatesboisfranc.fr If someone enter http://www.pilatesboisfranc.ca will it be track? I don't know anything about coding, I hope you can help because I would like to use the .ca doamine to track advertising on my car... Thank you, BigBlaze0 -
New GA interface - Number of conversion by source
Hi Guys, Hope this is an easy one for a GA ninja. In the new GA interface, how can I view the number of conversions by source, instead of the default conversion rate by source. For example, if I want to view the number of conversion from Adwords. I'm looking at Goals > Source / Medium > Google CPC and looking at Goal Set 1. However all data is expressed in percentages. Thanks in advance!
Reporting & Analytics | | David_ODonnell0 -
Linking domains vs Inbound Links
Hello, Whats the diference between Linking domains and Inbound links in Open Site Explorer? And also with is most important to analyze? Tks in advance! Pedro Pereira
Reporting & Analytics | | PedroM18