Universal Analytics and signup with Facebook

感情迁移 提交于 2019-12-02 22:59:05

I'm having the same issue. I'm still researching solutions, but one option I'm considering is this one: https://groups.google.com/forum/#!msg/google-analytics-analyticsjs/NtwQFQAZ2Oo/kh-T0c1eHCYJ Essentially, that author recommends that before you send the user to FB, you set a session variable to remind yourself "hey, next time you see this guy, be sure to overwrite his referrer". Then on every pageview, you check for that session variable. When set, you do:

ga('set', 'referrer', 'http://subdomain.site.com/facebooksigninreturn');

According to the author, that's supposed to prevent a new session from being created.

One potential problem with this approach is that if the user had another original referrer (say google), overriding the referrer seems to lose the original referral source. I experimented with setting

ga('set', 'referrer', '(direct)');

Since google attributes to the last non-direct source, this appears to work. Can anybody confirm if this approach is valid?

I've made some test on my side about this.

For information, 3DS credit card verification (for europeen country) is also affected since the user is redirected to bank url and come back to your website for paiement confirmation (So top referrer in my ecommerce funnel !! :S)

Looking at Google analytics real time > traffic source. It's seems that using a referrer like

ga('set', 'referrer', 'www.mydomain.com');

changed the referrer to www.mydomain.com but don't create a new session. It's also the same for OAuth Login that changed the referrer to socials Facebook.

I'm using the solution to set referrer to my actual domain for now since it's better than worst actual situation.

I will wait for fresh data on normal account (not the real time) to see what will be the result.

If you're OK with popups, try changing OAuth flow.

When I follow FB Login API example OAuth dialog opens in a popup window. Such OAuth flow will remove your issue with GA, because there will be no redirect from FB back to site.

Most of OAuth providers that I know also support opening a dialog in a popup window.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!