Skip to content

Instantly share code, notes, and snippets.

@kmclaugh
Last active June 29, 2021 14:04
Show Gist options
  • Save kmclaugh/b1c2bcd222ca256c15c8387dbebfe285 to your computer and use it in GitHub Desktop.
Save kmclaugh/b1c2bcd222ca256c15c8387dbebfe285 to your computer and use it in GitHub Desktop.
Ventura Travel

Below is the code that needs to be added when the user

  1. Submits an email
  2. Logins in
  3. 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
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment