Web Integration Considerations
Before integrating the JavaScript beacon for the Marketing Cloud Personalization module of the Salesforce Interactions SDK, you must consider the following.
- Whether to integrate the JavaScript beacon synchronously or asynchronously
- Whether to self-host the JavaScript beacon or host it on the Personalization CDN
Page flicker is a momentary flash of the original page content. Depending on how you'd like to deal with page flicker, there are two methods to choose from when integrating the JavaScript beacon for the Salesforce Interactions SDK - synchronous or asynchronous.
Synchronous integration loads the Personalization JavaScript beacon before loading the rest of the page. This integration method allows Personalization to prevent page flicker.
Asynchronous integration loads the JavaScript beacon after loading the page. With this integration method, Personalization can’t prevent page flicker.
To select the best integration method for your organization, talk to your business users about their requirements and desired use cases. The following table outlines some common pros and cons of each approach.
Synchronous | Asynchronous | |
---|---|---|
Summary | The Salesforce Interactions SDK loads completely before page content loads. This method of deployment is highly recommended for the best user experience. For a synchronous integration, Salesforce recommends deploying the JavaScript beacon in the header of the website. | The Salesforce Interactions SDK begins to load at the point it appears in the HTML for the page. Page contents continue to load while the SDK loads. |
Pros |
| Typically, you can use a tag manager, such as Google Tag Manager, for this integration. |
Cons | This method delays page rendering by the amount of time required to load the Salesforce Interactions SDK on the first viewed page and every two minutes thereafter. You can minimize the impact by:
|
|
For web integrations using the Marketing Cloud Personalization module of the Salesforce Interactions SDK, the Personalization content delivery network (CDN) hosts the JavaScript beacon. However, your organization can assume the responsibility of self-hosting the JavaScript beacon, if necessary.
The following table lists considerations for self-hosting the JavaScript beacon in web integrations for Personalization.
Consideration | Description |
---|---|
Disabling the JavaScript beacon | When you self-host the JavaScript beacon, you can’t use the toggle in Personalization to disable it. The toggle only functions when the Personalization CDN hosts the JavaScript beacon. If you want to disable the JavaScript beacon, your development team must do so. |
JavaScript beacon monitoring | When the Personalization CDN doesn’t host the JavaScript beacon, Personalization can't monitor whether events are being tracked and campaigns are being served correctly. When self-hosting the JavaScript beacon, you assume responsibility for monitoring and maintaining the hosting CDN to ensure that data is flowing as expected. |
JavaScript beacon refreshes | When you self-host the JavaScript beacon and update or edit your sitemap, you must refresh the JavaScript beacon to ensure the updates apply. Similarly, if you enable or disable a Personalization gear, you must refresh the JavaScript beacon. |
JavaScript beacon updates | Periodic updates or enhancements that Salesforce releases for the JavaScript beacon aren’t automatically applied to self-hosted JavaScript beacons. When self-hosting the JavaScript beacon, you assume responsibility for monitoring the Personalization CDN URL on a regular basis to ensure your JavaScript beacon version is up to date. If a new version is available, you’re responsible for updating the version you’re hosting on your CDN. |