Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Google Tag Manager - Track All Registrations with Google Analytics
mtschirs
✭✭✭
I am using the Google Tag Manager (check out my newest Tag Manager Plugin ) to track guests and users on my site.
Now, I want to track registrations of new users. This works fine for local registrations:
- In Tag Manager, create a new trigger that fires when a submitted Form ID equals "Form_User_Register".
- In Tag Manager, create a new Universal Analytics tag that fires on this trigger and creates a new 'Registration' event.
However, I also want to track social sign-ups via e.g. Facebook Connect or OpenID.
The problem is, the connect form does not have an ID and the URLs are different for each connect plugin. Is there a unified landing page after successful registration? How do you track social sign-ups?
Tagged:
1
Comments
Every user account is registrated through UserModel::register, so you can use the
UserModel_AfterRegister
event to cover all cases.My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
hm, I could redirect to a special landing page via this event + plugin and then track visits to that landing page. But I will wait for other, possibly cleaner suggestions first.
This is probably the cleanest suggestion. It covers all registrations.
If you need to redirect to a page, I would stash a parameter in the users session on the AfterRegister event:
Then you can redirect based on that:
You could also use the value in the session stash to insert the tracking code.
But there might not be a session at this point (I haven't tested), in that case you could use the user attributes for this.
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
Whoa, that's what I would have often needed for some quick and dirty debugging!
@Bleistivt: It might be clean if one performs server-side tracking, but Google Tag Manager injects external javascript and should ideally not require additional server side logic.
A cleaner solution would e.g. be if all social registration forms had an ID such as "Form_User_Register_Facebook". This would allow very precise tracking per social plugin out of the box.
@mtschirs
this is one way you can track signin by type
You'll also need to add this to conf/config.php to ensure it works well:
$Configuration['Garden']['SignIn']['Popup'] = FALSE;
Thanks for sharing, @Adrian! I might translate this into a GTM trigger for signin tracking.