Tip: Please Reference the core JavaScript documentation here. |
While not required:
- Sometimes it is easier to do JS polishing (e.g. email capture, search tracking) on GTM rather than in systems like Magento (PHP modifications).
- Some clients do utilize GTM for all event tracking and might prefer implementation managed there with RS as well.
Key GTM concepts that are relevant when setting up RS JS:
Trigger
The event that will cause a piece of code to run ("Tag"). Common examples include:
- Email form submission
- Global Page Views
- Search form submission
Examples:
- Trigger - User lands on a page
- Can be used to setup custom JS waves for segmentation.
- Can be used to setup custom JS waves for segmentation.
- Trigger - Form Submission
Tags
Can mostly copy RS's standard code to tags depending on the event. Modifications need to be made for things like:
- Gathering/replacing values (utm tags, emails).
- Changing logical if conditions depending on datalayer.
Examples:
- Tag - Email Capture
- Tag - Email Capture with properties
Double-check your website and form behavior: The email_entered action creates a user who is opted in to email, after which the user can only be unsubscribed. Make sure that the user has a chance to explicitly opt in before your forms trigger this action. |
Datalayer
What information is available to be used in tags.
Example:
- You can't do proper "Item View" or "Cart Add" waves if there are no item IDs in the datalayer ready to use.
Comments
0 comments
Please sign in to leave a comment.