All of the JS events work in a similar fashion, and share certain commonalities across the various events.
You can 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 eEvent
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.