Skip to content

Add Script To Your Website

Once a website is added and listed on the Website Settings page in Fluentos, the next step is to connect your website with Fluentos so the campaigns created for this website can be published to the site and made visible and accessible to the end-users. This can be achieved by installing Fluentos script on your website.

Installation options

  • Adding a tag in Google Tag Manager: Create a tag in your Google Tag Manager as per the instructions given on the page.
  • Adding a script to the website: Copy and paste the given script into your website header or footer page.

Whitelist Fluentos in Your Content Security Policy (CSP)

When using Fluentos on your website alongside a Content Security Policy (CSP), it’s crucial to ensure your CSP allows Fluentos to operate correctly.

CSP is a security feature that controls which resources (like scripts, styles, and images) can load on your site. By default, CSP blocks resources that are not explicitly permitted. If Fluentos is not included in your CSP policy, it might fail to load.

  • Allows the Fluentos client-side scripts to load and run on your site. The nonce-… part ensures that only inline scripts marked with this specific nonce can execute, helping maintain security while enabling the Fluentos Datahub functionality.

    Terminal window
    script-src 'nonce-9hmDFLK2hKG2OzPwMMSZlw==' https://*.fluentos.com
  • Enables your site to communicate with the Fluentos domain, whether fetching data, sending analytics, or making other network requests. Without this, Fluentos wouldn’t be able to receive or send the data required for its features.

    Terminal window
    connect-src https://*.fluentos.com
  • Permits inline styling needed by Fluentos to render its campaigns.

    Terminal window
    style-src 'unsafe-inline'
  • Allows images from the Fluentos domain to load on your site. This ensures any campaign images or other resources hosted by Fluentos appear correctly for your users.

    Terminal window
    img-src https://*.fluentos.com