Reputation: 328
I would like to track the behaviours of members and non members of my website through Google Analytics, but I have a problem: the login site is different from the main website and I can't put a GA tracking code on it.
So I setup a session custom dimension in Google Analytics. When the page is loaded, I set the custom dimension to "Non member". When a user click on the login button, I set the custom dimension to "Member".
Obviously, when a user reload the page, the custom dimension is set again to "Non member" and, due to the inner logic of Google Analytics, all the activities accomplished during the "member" session are accounted to the "non member" session.
If I set a cookie to track the login button clic, this cookie should be in sync with the Google Analytics session behaviour and this is not simple.
Do yo have idea to solve this?
Upvotes: 0
Views: 202
Reputation: 32760
You can overwrite custom dimensions in filters. So you could set up an advanced filter.
Field A extract Refererer (match-my-login-domain.com)
Fied B (do not set anything)
Output to Custom Dimension Member -> "Is a member"
Field A required Yes
Field A required No
Overwrite Output Field Yes
This will overwrite the Custom Dimension called Member with "Is a member" if the referer matches the url of your login page. Not tested, but I have used similar filters so I don't see why it shouldn't work four you (plus it requires no code at all).
Upvotes: 0