Learn how Content Delivery Networks (CDNs) and browser developer tools empower developers to deliver fast, reliable, and debuggable personalization experiences in Salesforce Marketing Cloud.
A Content Delivery Network (CDN) is a network of geographically distributed servers designed to cache and deliver web content closer to users, reducing latency and improving performance. In Salesforce Marketing Cloud Personalization, CDNs are pivotal for delivering the JavaScript beacon (part of the Salesforce Interactions SDK) that tracks user interactions and serves personalized content efficiently.
The JavaScript beacon, a lightweight script (typically ~50 KB when compressed), is hosted on a CDN with global points of presence (PoPs). When a user visits a website integrated with Personalization, the browser requests the beacon from the nearest CDN edge server. This ensures:
Personalization offers flexible integration methods, each leveraging the CDN differently:
<script src="https://cdn.evgnet.com/beacon/myaccount/mydataset/scripts/evergage.min.js"></script>
For self-hosting, replace the CDN URL with your own, e.g., https://yourcdn.com/evergage.min.js.
https://yourcdn.com/evergage.min.js
To maximize CDN benefits in Personalization:
Browser developer tools (accessed via F12 or right-click > Inspect) are indispensable for developers working on Salesforce Marketing Cloud Personalization. They provide deep insights into the webpage’s structure, network activity, and JavaScript execution, enabling efficient debugging and optimization of personalization integrations.
The Elements tab shows the webpage’s DOM and applied CSS styles, making it ideal for verifying that Personalization content zones and tracking selectors target the correct HTML elements.
Use Case: Confirm that a content zone (e.g., a hero banner) is applied to the intended element.
contentZones: [ { name: 'hero_banner', selector: '.hero-banner' } ]
In the Elements tab, search for .hero-banner to ensure the element exists and is styled correctly. You can also hover over elements to highlight them on the page or edit the DOM in real-time to test selector changes.
.hero-banner
The Console tab logs JavaScript errors, warnings, and custom messages, making it a go-to for debugging Personalization SDK issues, such as beacon initialization failures or event tracking errors.
Use Case: Log initialization status or catch errors if the beacon fails to load.
if (window.SalesforceInteractions) { console.log('Personalization SDK initialized successfully'); } else { console.error('Failed to load Salesforce Interactions SDK'); }
Use the Console to filter errors (e.g., CORS issues with the CDN) or log custom events, like user interactions with personalized content.
The Network tab monitors all HTTP requests, including the CDN-hosted beacon, Event API calls, and personalized content delivery. It’s critical for analyzing load times, response statuses, and CDN performance.
Use Case: Verify that the beacon loads quickly and that personalization campaigns are delivered via the Event API.
SalesforceInteractions.sendEvent({ interaction: { name: 'view_product' } });
In the Network tab, filter by XHR to inspect API calls or by JS to check the beacon’s load time. Look for 200 OK responses and analyze the waterfall chart to identify bottlenecks.
The Sources tab allows you to view and debug JavaScript files, including the Personalization beacon. You can set breakpoints to pause execution and inspect variables, making it ideal for troubleshooting complex Sitemap configurations.
Use Case: Debug a page type match in the Sitemap.
const sitemapConfig = { global: {}, pageTypes: [ { name: 'Product Page', match: { url: { regex: '/product/.+' } }, entity: { type: 'Product', id: 'product_sku' } } ] }; SalesforceInteractions.init(sitemapConfig);
In the Sources tab, locate evergage.min.js, set a breakpoint in the initialization logic, and step through to verify that the regex matches the current URL.
evergage.min.js
The Application tab displays cookies, local storage, and session storage, which are used by Personalization to track user sessions and preferences. It’s essential for ensuring compliance with privacy regulations and debugging tracking issues.
Use Case: Verify or clear Personalization cookies for testing or opt-out scenarios.
SalesforceInteractions.clearCookies({ domain: '.example.com' });
In the Application tab, check the Cookies section for Personalization-related cookies (e.g., evg_user_id) and confirm they’re set correctly or removed when needed.
evg_user_id