Skip to main content

How to Enable Saleswings Interactions on your Website

Desmond Wolkins avatar
Written by Desmond Wolkins
Updated this week

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.

  1. Make sure the main SalesWings sw('init', ...) script is already on your page.

  2. Add the sw('enablePopups', ...) command after the init 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").

  1. On the Main (Host/Outter) Page
    The script on the main page must be configured with mode: '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'
    });

  2. Inside the iFrame (Guest) Page
    The script on the page loaded inside the iFrame must be configured with mode: '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 replace main-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!

Did this answer your question?