-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zj cp/end lifetime sale #1492
Zj cp/end lifetime sale #1492
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const {contact_id} = await requestSignInEmail(submittedEmail) | ||
|
||
cioIdentify(contact_id, { | ||
email: submittedEmail, | ||
[INTERESTED_IN_LIFETIME_SINCE]: Math.floor(Date.now() / 1000), | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a user isn't signed in, they can enter their email which will send a sign in request to rails (effectively creating an account if there isn't one) which we can use the contact_id
to identify the user in CIO
}) | ||
} else if (subscriber) { | ||
cioIdentify(subscriber.id, { | ||
[INTERESTED_IN_LIFETIME_SINCE]: Math.floor(Date.now() / 1000), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CIO needs you to divide by 1000 for their time format
const INTERESTED_IN_LIFETIME_SINCE = 'interested_in_lifetime_since' | ||
|
||
export {INTERESTED_IN_LIFETIME_SINCE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we didn't want to have special strings for CIO attributes in the file we were working with so created this util file to organize any attributes we are setting in egghead-next
allowPurchase=true
if
allowPurchase=true
is set as a query param then the user can purchase lifetime subscriptionno allowPurchase=true
if
allowPurchase
is anything other thantrue
then this form will be displayed that will prompt the user to enter email to be notified when a future sale goes live. If the user is logged in there will just be a button.This will add them to a segment in customerio
Interested in Lifetime
that is data-driven and checks if the attributeinterested_in_lifetime_since
exists. When the user signs up a data is set so we know when they signed up and can filter them out of the segment if we run a sale.