Below is the code that needs to be added when the user
Signs up Logs in
The {{variable}} templates need to be filled in with the actual values.
| /* | |
| * action: login | |
| * description: fire whenever a returning user logs in | |
| * notes: | |
| */ | |
| window.dataLayer = window.dataLayer || []; | |
| window.dataLayer.push({ | |
| event: "login", | |
| data: { | |
| userInfo: { | |
| userId: "{{userId}}", // The user id | |
| emailAddress: "{{emailAddress}}", // The user's email address | |
| } | |
| }, | |
| }); |
| /* | |
| * action: signup | |
| * description: fire whenever a new user signs up for the first time | |
| */ | |
| window.dataLayer = window.dataLayer || []; | |
| window.dataLayer.push({ | |
| event: "signup", | |
| data: { | |
| userInfo: { | |
| userId: "{{userId}}", // The user id | |
| emailAddress: "{{emailAddress}}", // The user's email address | |
| } | |
| }, | |
| }); |