Getting Started: Enabling Interactions on Your Website
To begin displaying popups on your website, you must first ensure the SalesWings tracking script is installed on your pages and configured to show Interactions. This process involves adding a small piece of JavaScript to your site's code.
The system uses a long-polling mechanism to communicate with the SalesWings backend, allowing it to determine in real-time when a pop-up should be displayed to a visitor.
Standard Installation
For most websites, you can enable Interactions by adding the following commands to your existing SalesWings tracking script.
Make sure the main SalesWings
sw('init', ...)
script is already on your page.Add the
sw('enablePopups', ...)
command after theinit
command. Your complete script should look similar to this:
// Initialize the main tracking script
sw('init', {
pid: 'YOUR_PROJECT_ID',
// other configuration options
});
// Enable the Interactions feature
sw('enablePopups', {
apiUrl: 'https://helium.saleswings.pro/tracking/personalization'
});
π‘ Important: Remember to replace YOUR_PROJECT_ID
with your actual Project ID from your SalesWings account.
Advanced Installation: For Pages with iFrames
If your popups need to appear on a page that contains an iFrame, or if the popup content itself is within an iFrame (for example, a form hosted on a different domain), additional configuration is required. You will need to add specific tracking scripts to both the main page (the "host") and the page within the iFrame (the "guest").
On the Main (Host/Outter) Page
The script on the main page must be configured withmode: 'host'
in the binding settings.// Script for the main page hosting the iFrame
sw('init', {
pid: 'YOUR_PROJECT_ID',
binding: { mode: 'host', selector: 'iframe' }
// other configuration options
});
sw('enablePopups', {
apiUrl: 'https://helium.saleswings.pro/tracking/personalization'
});Inside the iFrame (Guest) Page
The script on the page loaded inside the iFrame must be configured withmode: 'guest'
// Script for the page loaded inside the iFrame
sw('init', {
pid: 'YOUR_PROJECT_ID',
binding: { mode: 'guest', trustedDomains: 'main-page-url.com'}
// other configuration options
});
sw('enablePopups');
π‘ Important: Remember to replacemain-page-url.com
with the actual domain of the main (host) page.
Have any questions or concerns? Feel free to reach out to your Customer Success Manager!