Below is the code that needs to be added when the user
- Submits an email
- Logins in
- Signs up
The {{variable}} templates need to be filled in with the actual values.
| /* | |
| * action: login | |
| * description: fire whenever a user submits and email address | |
| * notes: see video https://www.loom.com/share/a08f693a5dd24bb288a348ca6e7805d4 | |
| */ | |
| window.dataLayer = window.dataLayer || []; | |
| window.dataLayer.push({ | |
| event: "emailSubmit", | |
| data: { | |
| userInfo: { | |
| emailAddress: "{{emailAddress}}", // The user's email address | |
| } | |
| }, | |
| }); |
| /* | |
| * 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 (ie creates an account) | |
| */ | |
| window.dataLayer = window.dataLayer || []; | |
| window.dataLayer.push({ | |
| event: "signup", | |
| data: { | |
| userInfo: { | |
| userId: "{{userId}}", // The user id | |
| emailAddress: "{{emailAddress}}", // The user's email address | |
| } | |
| }, | |
| }); |