</body> tag. If you want to use Google Tag Manager to install, follow the instructions below.
That’s it! Now you’re ready to use our web SDK. Below is an example snippet for the US region.
|false||If you want to send in-app messages to your website, you must set this to |
You no longer need your Organization ID
If you enabled in-app support before January 26, 2023, you used your
organization-id when configuring our SDKs so that you could send in-app messages. You can leave this code in your SDK configuration, but it’s no longer necessary; you can send in-app messages without it.
data-cross-site-support parameter is designed to help you use the snippet in situations where cookies might not be available.
When set to
true, the SDK can set cookies when you use certain third party platforms like Shopify. Shopify uses
iframes to embed your website, and this setting enables the SDK to set first-party cookies from your embedded site.
Cross-site tracking may not work for all users. Safari blocks cross-site tracking by default (via the Prevent cross-site tracking setting).
data-enable-in-memory-storage can help you use the web SDK in some situations where cookies aren’t available.
When set to
true, the web SDK will store information in memory as a fallback. This setting allows for tracking when cookies aren’t available due to privacy settings, running on third party platforms, etc.
If a user’s cookies are unavailable and they haven’t been identified, you won’t be able to track their anonymous activity; anonymous tracking is unavailable when reading from memory. But if a user’s cookies are available, anonymous tracking will work as it normally does.
The web SDK exposes the following functions.
|Identifies a person and updates their attributes. Future calls reference this person.|
|Sends a |
|Sends a custom event, representing a person’s activity on your website.|
|Stop identifying a person. You might send this call when someone logs out or refuses tracking consent.|
|Listen for an in-app message event.|
|Stop listening for an in-app message event.|
- Log into Google Tag Manager and go to the container for your website.
- Create a new tag and select Custom HTML as your tag type.
YOUR_SITE_IDwith your workspace site id.
- Go down to the Triggering section and add the All Pages trigger. Or, create a custom trigger that covers the individual pages or sections of your website or app that you want to track events from, collect page views from, and show in-app messages on.
- Save the new tag with your preferred tag name.
Create a new tag and select Custom HTML as your tag type.
User IDvariable in your GTM workspace. Your actual implementation will differ based on how your GTM container is configured.
Below the HTML text area are Advanced Settings. Expand the section and look for Tag Sequencing. Select the first checkbox Fire a tag before… and select the tag that you created in the previous section.
Go down to the Triggering section and add the All Pages trigger. Or, create a custom trigger covering just the pages or sections of your website or app that you want to track events, collect page views, and show in-app messages.
Save the new tag with your preferred tag name.
- Click GTM Preview and go to a page or screen where you would expect to see user activity.
When you’ve verified the integration, submit the changes in GTM and publish the new version.