Reputation: 657
I have dadded Universal Analytics to Google Tag Manager with it's default settings. Currently I have below code in the user registration page:
_gaq.push(['_trackEvent', 'Account Events', 'Create Account', 'Create new account ']);
How can I convert this to 'DataLayer.push' ? Is there any configuration changes needed in GTM side? Please let me know.
Thank You.
Upvotes: 0
Views: 148
Reputation: 8907
You could do something like this which happens when the account creation form is successfully submitted:
dataLayer.push({
'event': 'account created',
'cat': 'Account Events',
'act': 'Create Account',
'lab': 'Create new account'
})
and then in GTM, you would need to create the event tag with the respective macros for the category, action, and label.
The event tag would fire on this rule:
{{event}} equals "account created"
Upvotes: 2