Google Analytics track to Initial Referrer - google-analytics

A user clicks on a referring link to visit our eCommerce website, but does not yet place an order. Then the user goes back directly to our website at a later point and places an order. How can we set up in google analytics / tag manager that the initial referrer should stay the referrer for this user?
Example: A customer visited example.com and clicked on a link to our website. Then the customer bookmarked our website url. Then at a later point, the customer visits our website through the bookmark or through a Google search. How do we track that example.com was the original referrer for this customer?
Thank you for your help.

If the user returns with the bookmark, the previous source will automatically result as a consequence of the standard Google Analytics attribution model. While if accessed from organic search this will overwrite the previous source.
What you can do to save the first source is to install a cookie on the user's browser so that the first time it saves the source in a custom dimension, while if the cookie already exists it does not save it.

Related

Manually setting the Google Analytics Client ID

I have a sub-domain that I am unable to put GTM or GA tracking code on. I have GA on the main domain.
I can retrieve the _ga cookie and get the Client ID but but if a user has not been to the main website they won't have one.
My question is:
Can I set a cookie called _ga (in the same format as GA sets it) and will this get picked up by GA if the user then goes back to the main website?
This article seems to be what you need:
Cookie Settings And Subdomain Tracking In Universal Analytics
https://www.simoahava.com/analytics/cookie-settings-and-subdomain-tracking-in-universal-analytics/

Can I track multiple pages on the same domain, in a single Google Analytics goal/event?

These are the steps on my site:
Step 1: User enters data in a form and submits it.
Step 2: User is redirected to a Plug n Pay page (which is still on the same domain), where they enter their payment information.
Step 3: User is then redirected to the success page.
I would like to track this process as a single event/goal. From what I have read on other sites, I assume I'll have to use ecommerce feature on Google Analytics.
I guess you need a Funnel: Goal type Destination with steps.
At first you need to set sending of virtual pages for successful form submission and successful payment.
If you want to track transactions, you need to set ecommerce feature.
If you want to measure payment just as fact (without informations about money), you can use event or virtual page.
Virtual page URLs you need to add in Goal settings, and the main field in goal will real URL of your final page (success-page).

Google Analytics Referral Path Empty When Using Campaign URL Builder

A URL was generated using Google Analytic's (GA) URL Builder (https://support.google.com/analytics/answer/1033867?hl=en).
The URL includes the utm_source and other required params for GA.
When clicking on a link with this URL the Referral Path is not available. Instead only the Source shows with an empty Referral Path. The Source is set to the value of utm_source.
However, when visiting the page WITHOUT the custom URL via a link the Referral Path is set correctly.
Why does this happen? How can I fix this?
You cannot fix this. Referral Path is available for referral traffic. If you use campaign parameters you turn your link into campaign traffic (this is obviously some unusal use of the word referrer, but Google is thinking in terms of marketing channels instead of the technical definition).
The way around would probably be a custom dimension that stores the referring url.
First you'd have to create a custom dimension in the property settings - I'd go for session level, since the referrer that brought a visitor to your site does not change during the visit.
Then you check (in the source code of your website) window.document.referrer to see if originates from your own domain (in which case you dismiss it) or from another domain, in which case you set it as a dimenson. Basic example (not production code):
if(window.document.referrer.indexOf('mydomain') == -1) {
ga('set', 'dimension1', window.document.referrer);
}
(meaning: if the name of my domain is not a part of the string that makes up the referrer url; and this would be followed by your usual page tracking).
This will store the referrer regardless and you can select your custom dimension as a second dimension or use it in custom reports (of course for CPC traffic or dispay advertising you will get google.com or the adress of the adserver as referrer which isn't that helpful, but for your use case it should work).

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.

Track Keywords from Google Adwords and GA and store them

I run an adword campaign on google.
Users type in keywords and come to my landing pages via few ad's they see. Now my landing page has some 2 pages. One has informational which brings a user directly to the landing page after ad click - second is a signup form. Now I wish to capture the keywords he has typed in and then come into this form so that we know how users are reacting to our ads and what do they type to get to us.
The complex part is how can we use the GA - API to track this down. Since user will landing on /page and may signup finally from /page1 so we need to store those kewyords from his url (which is done via the Value Track codes in the url) and then store in the cookies so that when he later comes to /page1 and is signing up the same keywords can be passed and stored in the backed?
Is this possible and some can please help with this - where to look for how to accomplish this.
Thanks
I append a code to my ad's URL in AdWords:
www.example.com/?code=some-unique-id
On the landing page I check for the query string parameter, and if found store it in a cookie.
Any subsequent pages can access the cookie, and get the code from the original landing page.
This is only ad-group level, but it's a start.

Resources