Repository navigation
Sitemap
You can utilize javascript Promises directly within pageType isMatch functions to verify that a condition has been met before attempting to capture any details from the web page. This example highlights waiting for a specific element to load on the web page before trying to confirm a page type match.
link to code >>
For circumstances where you have the same Sitemap running on more than one website and those websites have completely different domains, you must set the cookie domain accordingly. This example highlights how to set the cookie domain and also how to define and check allowed domains for an added level of assurance that the Sitemap can only be initialized on pre-defined websites.
link to code >>
This example highlights how to set the locale in the Global object.
link to code >>
This example highlights how to retrieve the value of a querystring parameter and then set a user attribute to that same value.
link to code >>
While the beacon script for MC Personalization will capture the geolocation of a user, that location is not made available to the Sitemap.
This example highlights how to get the geolocation from the browser for use in the Sitemap and then check the distance between it and a different location.
link to code >>
This example highlights how to set custom attributes on the line item of a purchase. This information cannot be used in segmentation but it can be used in campaign templates. This has only been verified to work with the SalesforceInteractions namespace.
link to code >>
This example highlights three things:
- How to track when a specific HTML element is within the browser viewport
- Dispatch a custom event
- Use
SalesforceInteractions.listnerto listen for the custom event