All of the JS events work in a similar fashion, and share certain commonalities across the various events.
You can also read more about each specific event, as well as view code samples for each event on their respective pages listed below.
Retention Science tracks the following events:
- Regular Page View
- Item Page View
- Add to Cart
- Shopping Cart View
- Checkout Success
- Checkout Success with Order Data
- Email Capture
- Custom Event
Commonalities across all JS events
- There is a static site ID that is always a string unique to your site, this will be provided during your Onboarding Kickoff call.
- There is always an "if" condition to analyze if a user is logged in or not, and if they are you should add the user_id or email value in the wave as indicated in the code examples.
- Only one is needed to ID the user.
- We do cookie track users, so users that have browsed anonymously will have past actions associated automatically if they ever log in or click on an email and land onsite.
- There is always a final "track" code line (static) which causes the event to be tracked.
- There is always the immediately invoked function at the end of each script which is required for the JS tracking to work.