Track across subdomains - google-analytics

What's the best way to track across subdomains? Here's the scenario:
Customers on my site can create their own custom site name or subdomain. For example, if John Doe signs up as a customer, they can create their own personal subdomain of: johndoe.mydomain.com. In a sense, subdomains are created dynamically as each new customer signs up and creates their own subdomain.
Once someone signs up as a customer, they have access, or the ability, to sign up for another service that allows them to accept online donations. Should they choose to buy this capability or product, they are taken to a subdomain of: admin.forms.com. It's on this subdomain where customers can purchase this add-on. So basically, customers are moving from their own custom subdomain to admin.forms.com to signup for this service.
The goal is to see how many customers are signing up for this service. Does it make sense to create a new property for admin.forms.com? Or should I use a view or segment?
Thanks in advance for any suggestions/insight.

Since the subdomains actually belong to different domains you would need to set up proper cross-domain tracking if you want to track across domain boundaries.
Pageviews by the same visitor are connected to a session via the clientId. The clientId is stored in a cookie. Cookies are domain specific. Since cookies from mydomain.com cannot be read by a client browsing forms.com the clientId needs to be carried over as query string parameter. That's what cross domain tracking does.
Since you want to view traffic to your two (sub)domains as if this was a single domain (i.e. you want an uninterrupted "user journey") using additional views or properties would defy your purpose).
Unless you specifically set the cookieDomain value either to "auto" or to the top domain the cookie will be valid for the subdomain(s) only, so you won't have to worry that this interferes with tracking on the top domain level (however if you expect users to browser on the top domain level (e.g. switch from admin.forms.com to plain forms.com) then you should set the cookieDomain field to auto, else GA will allocate a new clientId when the user switches from subdomain to main domain).

Related

Is it possible to pass session data across domains with multiple Google Property IDs?

My situation is that I need to track data from:
Domain A with Google Property ID UA-XXXXXX-1
to
Domain B with Google Property ID UA-YYYYYY-2
Problem is, I need to be able to track the source of traffic to Domain A (organic, campaign, referral etc) in the Google Analytics property for Domain B.
As in, if i'm viewing data for a page in Domain B, i'd like to be able to see that the user originally found the referring page on Domain A via an email campaign using a UTM parameter.
Cross domain tracking is enabled on Domain A with Domain B set as an autoLink domain.
Question is, on the link from Domain A to Domain B, is their any way I can "push" the session data captured by UA-XXXXXX-1 across into Domain B so that it can be pushed to UA-YYYYYY-2?
I know the simplest solution to this is to add UA-YYYYYY-2 to Domain A, but that isn't an option.
Thanks
You can try saving in cookie the source and medium on Domain A when user landed (based on document referrer) then add them as UTM parameters in querystring on all URLs from A to B. However, in this way you can know the source/medium but user and session will be different from the domain A.

What approach to select for Tracking a Sub-Domain in Google Analytics

This is a new setup, no historical data.
My objective is to be able to track the domain, as well as sub-domain.
Setup that i have:
domain.com - User generated content site
sub.domain.com - E-Commerce Shop.
Create a New Property for sub.domain.com in addition to domain.com ?
Or Create a Different View in the Property ?
To be precise, i need to know which method to select and why ?
Yes, there are previously asked questions over SO relating to "How to track sub-domains" but none show describing the reason to select an approach.
Sub-domains are tracked automatically by Google Analytics you just need to set the Cookie-domain property to auto.
You can create a new view for your subdomain and analyze data only for that sub-domain that would be more efficient.
Let say you have a site named mydomain.com and have one blog for that also like blog.mydomain.com.So, for both you can have different views and one combined view then it's up to you how you want to analyze the data.
ga('create', 'UA-12345-1', 'auto');
// is the same as
ga('create', 'UA-12345-1', {'cookieDomain' : 'auto'});
Refer the below document for more information on tracking sub-domains.
[https://support.google.com/analytics/answer/1034148?hl=en][1]
This depends on your use case.
If the content of your subdomain is strongly connected to your main domain you probably want to use the same tracker for both without modifications. This will allow you to track user sessions that move between main domain and subdomain. You would either create a view to filter by subdomain, or simply create a filter that adds the subdomain to the page path (so you can discern Urls from the main and subdomain) and look at them in the same view.
If main domain and subdomain share a tracker and a cookie with the client id this has at least two implications. Users that have visited your main domain in one session and the subdomain in another will be recognized as recurring users. Also sampling in a free GA account happens on the property level, so if you track main domain and sub domain via the same tracking id sampling will occur more frequently (on sites with much traffic).
If you want to avoid either you should use separate GA properties for main domain and sub domain and maybe change the cookie domain for your subdomain (documentation for the current gtag.js is here).

Session-duration-only access control to DNN pages

We have a customer with an unusual request for the security of a subset of a DotNetNuke / Evoq website.
This is a special set of pages that should only be accessed by a large group of a company's employees to make preferred-discount purchases.
Rather than trying to maintain a set of thousands of user accounts, having the employees register to gain access passwords, they just want to have the employee get to a welcome page, provide their email address (which will be confirmed as from that company's domain) and then be sent a link or a link and temporary rotating passcode that grants access to that set of pages for just the duration of their session once they visit the link.
I've searched for any type of 3rd party module to accomplish this with no luck.
It has also been suggested this might be accomplished through some type of URL-masking process, which I suppose might even be done by a proxy outside of DNN.
Has anyone provided a similar type of security solution before, either within DotNetNuke or through a proxy?

Sub-domain tracking with Google Tag Manager

I'm trying to set up tracking with GTM between the main domain and its subdomain. I've read a lot on this topic already, including this Google guide (it's about different domains but not sub-domains) and guide from Lunametrics. But still I can't find the answer.
So what I have now:
site.com and blog.site.com
Two separate containers for each of them
Two different properties in Universal Analytics.
What I need is tracking the domain with it's subdomain. I assume I'll need to create a separate view with filters in GA. Please let me know how to configure that tracking right. I wouldn't like to use one single container for the domain and its subdomain.
What you need is a single property. Implement the same code on domain and subdomain.
Set the cookie domain to "auto" (or do not set it all). This means the Google code sets the cookie for the highest accessible "level" from the domain (i.e. Google cannot set a cookie for the .com TLD, so it will use the next level, in your example site.com). It also means the cookie is available on the subdomains for your url.
That's basically it - your property will report users from domain and subdomain and will maintain the session when they switch between domain and subdomain.
However if you have pages of the same name on both domain and subdomain - say site.com/index.html and blog.site.com/index.html - they will be lumped together in the reports. To separate them you can set the hostname as second dimension, or apply a filter to your data view that adds the hostname to the url path (here is randomly googled tutorial on how to do this).

Shibboleth being passed as referrer in Analytics

Been searching for an answer for this for a while but nothing that I can find that is useful.
Basically in the organisation I work in we use Shibboleth for user authentication.
We probably have 200+ sites & Shibboleth works effectively for these.
However, one site in particular is protected using Shibboleth (if the user is not a valid user they have to sign up for an account in this process also) which is causing an issue with our Analytics (Google Analytics). The referrer to the site is ALWAYS the shibboleth authenticator.
What we need is a facility to track conversions on this site based on source/campaign the user arrived from. The proposed solution right now is to use a Tag Manager product to fire off specific tags based on a combination the referrer or campaign. This one single site is used for a multitude of things (all prospective leads to EPR) but we need different information based on how the user landed on that page.
We are tracking all the interaction points that lead up to this (i.e. tracking potential leads) but a lot drop out during the signup process and right now we do not have actual conversion data, meaning the Marketing etc is being spent based on highest traffic source rather than which source or campaign is most effective.
The problem is when a user signs in, signs up using Shibboleth, Shibboleth sets a new cookie for that session. In Google Analytics all the referrer to this site are from the authenticator.
Is there some configuration issue with GA that I am overlooking for this scenario or is there something that can be done with Shibboleth so that the initial referrer (rather than the authenticator) being passed as the referrer which in turn would facilitate the rule creation of the Tag Manager to fire off the required tags
If you use Universal Analytics, you might be able to overcome using the new Referral Exclusion:
You can exclude specific domains from being recognized as referral
traffic sources in your Analytics reports. A common use for this
feature is to exclude traffic from a third-party shopping cart to
prevent customers from being counted in new session and as a referral
when they return to your order confirmation page after checking out on
the third-party site.
Google Analytics recognizes the URL you use to set up a new property
in your account and automatically excludes this domain from your
referral traffic, so you won’t see self-referrals in your Analytics
reports.
https://support.google.com/analytics/answer/2795830?hl=en
Another option might be to pass a parameter across the login page when you request an authentication. If you set your fields in the request correctly, you could have Shibboleth send your user back to any page or with any query string, such as adding ?source=original_page_name. After authentication, these parameters should be available to manipulate or pass on to GA. This won't actually spoof your referrers, but it will get you the data you need.

Resources