0

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?

user3331119
  • 235
  • 4
  • 12
  • Be aware that question about configuration and report would usually be off-topic on stackoverflow (which deals with code-related questions). However I have managed to come up with an answer that includes some code, so it might be alright :-) – Eike Pierstorff Feb 12 '15 at 08:57

1 Answers1

1

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).

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
  • Ahh, ok. Interesting that one can provide the utm_medium as a referral but that still doesn't show the referral path. I'm assuming that google is still capturing this but perhaps not showing it. In the docs they are unclear about when document.referrer gets set or not. Excellent answer and suggestion. Thanks! – user3331119 Feb 12 '15 at 08:59
  • Actually if you set medium to referrer the idea is that you would set the source parameter to the url of the referring site. – Eike Pierstorff Feb 12 '15 at 09:21