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.

SynchronousAsynchronous
SummaryThe 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
  • Personalization can track data and deploy personalized campaigns as soon as possible within the browser page lifecycle.
  • This method is compatible with ZeroFlicker, which prevents content from popping into view and then flickering as personalized content replaces the default content on the page. Instead, the first visible content is already personalized.
Typically, you can use a tag manager, such as Google Tag Manager, for this integration.
ConsThis 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:
  • Reducing the data size of the Salesforce Interactions SDK
  • Delivering using a global content delivery network (CDN)
  • Using client-side caching
  • This method can potentially present a poor user experience due to page flicker. Flicker occurs when content appears on the page and then rapidly changes after the initial page loads as the SDK personalizes the page content.
  • This method can delay tracking and personalization. Depending on the site and complexity of the page and other loaded libraries, this delay can increase, which can cause missed page tracking as users navigate away quickly.

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.

ConsiderationDescription
Disabling the JavaScript beaconWhen 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 monitoringWhen 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 refreshesWhen 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 updatesPeriodic 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.