google-analyticsanalytics.js

How to exclude oauth referrer from Google Analytics?


I got real headache with Google Analytics on my project that have authentication via third-party services (like as Google+, Facebook and etc). I googled and read a lot of information about it but it helped partially or not helped at all.

The problem description:

When you use any services for authenticate your users - you should send your user to auth service and it will send back after authentication and agreement check on their side. When user returned to your side he have referrer and Google Analytics understand it as new session with input channel from this auth service. Because of this we can't give any assessment to our traffic channels, because all future events have dependence with this new session.

oauth.vk.com - it's service that make third-party authentication for our web app


The solutions I found:

  1. The most popular and logical crouch it's setting your domain referrer manually before send pageview event after redirecting from auth service. It's should allow do not break the session and save origin source of entrance.

It's not working! And I don't understand this behavior. With this method I got follow problems:


  1. Next popular idea that I read it's excluding specials domains from analytics.

For first I was afraid of trying it because I thought that it just hide data from my analytics. But after I read some comments that it will automatic associate future events with current session and will not show referrer sources. It's sound good and sound as alternative of first method.

enter image description here

I tried this but got more misunderstandings... Google Analytics continue to display oauth referrer like as if I did not exclude this domain. (more then 7 days have passed after change setting of exclude domains).

P.S. Also I tried to combine first and second methods and see some kind of zoo... (own domain as source of sessions, sources that excluded).

P.S.2. Application work with analytics.js library.

Do you have the same problem with GA and how you solve it? Thanks!


Solution

  • Setting manual referrer usually works. But GA will still report oauth source for users that were previously assigned oauth source and only visited your site directly since then. You can check it with direct session in your reports as a secondary dimension. If this is a case then you hardly can do anything but wait until these users sources will be reassigned.