Title: How to install Headline Testing
Author: Lucas Radke
Published: June 16, 2025
Last modified: July 6, 2026

---

 1. [Installation resources](https://docs.parse.ly/installation-resources/)
 2. [Add-on Features](https://docs.parse.ly/installation-resources/add-on-features/)
 3. How to install Headline Testing

#  How to install Headline Testing

This guide outlines the technical requirements and best practices for installing
and customizing Parse.ly’s Headline Testing feature. Proper installation ensures
headline variants load efficiently and tests perform reliably across all supported
browsers and platforms.

## Installation through the Parse.ly WordPress Plugin

Headline Testing can be enabled and configured directly from the WordPress Admin
area by using the [Parse.ly WordPress plugin](https://docs.parse.ly/installation-resources/installation-tools/wordpress-plugin/).
This option allows for Headline Testing install without manually adding scripts 
or editing templates.

Review the [Configure Headline Testing in the Parse.ly WordPress Plugin](https://docs.parse.ly/installation-resources/add-on-features/install-headline-testing/configure-headline-testing-in-the-parse-ly-wordpress-plugin/)
guide.

## One-line snippet script installation

Place this script in the <head> **before** any other scripts but **after** all <
meta /> tags:

    ```lang-html
    <script src="https://experiments.parsely.com/vip-experiments.js?apiKey=XXXXX" data-enable-live-updates="true"></script>
    ```

Make sure to add your [Site ID](https://docs.parse.ly/site-id/) as the apiKey to
the script’s source. This should be a domain-like value, such as example.com, and
not your API Secret! Please ensure to test the script on your staging website first
to ensure everything loads correctly and there are no errors in your browser console.

Note that in the script above, we’re recommending that you enable the “live updates”
[configuration option](https://docs.parse.ly/install-headline-testing/#3-configuration-options)
by default. You can remove this option if you so choose.

The script is approximately 9kB (gzipped) and is delivered via our global edge network.
This implementation loads the script synchronously, ensuring experiments run as 
often as possible.

To load the script asynchronously, add the `async` or `defer` attributes. However,
note that experiments may run less frequently if the script executes **after** the
first contentful paint.

## Advanced installation

In the Advanced Installation method, you will directly run a block of inline JavaScript
code/snippet, loaded in your webpage’s <head> tag. This method offers more control
over how the headline testing suite behaves and provides more configuration options.

    ```lang-html
    <script>
    !function(){"use strict";var e=window.VIP_EXP=window.VIP_EXP||{config:{}};e.loadVIPExp=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(e.config=n,e.config.apikey=t,function(e){if(!e)return;var t="https://experiments.parsely.com/vip-experiments.js"+"?apiKey=".concat(e),n=document.createElement("script");n.src=t,n.type="text/javascript",n.fetchPriority="high";var i=document.getElementsByTagName("script")[0];i&&i.parentNode&&i.parentNode.insertBefore(n,i)}(t),n.enableFlickerControl&&function(){var t,n;if(null!==(t=performance)&&void 0!==t&&null!==(n=t.getEntriesByName)&&void 0!==n&&null!==(n=n.call(t,"first-contentful-paint"))&&void 0!==n&&n[0])return;var i="vipexp-fooc-prevention";e.config.disableFlickerControl=function(){var e=document.getElementById(i);null!=e&&e.parentNode&&e.parentNode.removeChild(e)};var o=document.createElement("style");o.setAttribute("type","text/css"),o.appendChild(document.createTextNode("body { visibility: hidden; }")),o.id=i,document.head.appendChild(o),window.setTimeout(e.config.disableFlickerControl,500)}())},

    // your Parse.ly Site ID here
    e.loadVIPExp("XXXXXXXX",{
    	enableFlickerControl: true
    })
    }();
    </script>
    ```

## Installation through tag manager

We do not recommend installing the script using a tag manager. This method may introduce
a delay in script execution which can lead to experiments running less often.

## Configuration options

### Flicker control

If the script loads asynchronously, you may experience flickering as headlines are
replaced. To minimize this, use the advanced installation method and enable flicker
control, which hides the page body for up to 500ms.

Note that this option is only available via the Advanced Installation technique:

    ```lang-js
    // Rest of advanced script

    e.loadVIPExp("XXXXXXXX",{
    	enableFlickerControl: true
    })
    ```

### Live updates

By default, headlines are swapped during the initial page load. If your website 
loads articles dynamically, as is the case with [Single-Page Applications (SPA)](https://docs.parse.ly/installation-resources/parsely-integration/tracking-code-setup/single-page-application/),
and you want headlines to be updated for newly added anchors, you can enable live
updates.

When live updates are enabled, the system watches the page after the initial swaps
and automatically updates headlines for eligible anchors as new links appear. You
can also configure how long this lasts – by default, we watch the page for 30 seconds.

Example of how to enable live updates for 5 seconds using the One-Line Snippet:

    ```lang-html
    <script src="https://experiments.parsely.com/vip-experiments.js?apiKey=XXXXX" data-enable-live-updates="true" data-live-update-timeout="5000"><script>
    ```

##### Example for the advanced installation option:

    ```lang-php
    // Rest of advanced script

    e.loadVIPExp("XXXXXXXX",{
    	enableLiveUpdates: true,
    	liveUpdateTimeout: 5000
    })
    ```

### Swapping after content load

The `allowAfterContentLoad` configuration option lets our algorithm bypass the First
Contentful Paint (FCP) checks and swap out headlines even after the main content
has already loaded. This is particularly useful if you’re loading the script with
defer and are okay with a potential flicker.

Example for the advanced integration option:

    ```lang-html
    <script src="https://experiments.parsely.com/vip-experiments.js?apiKey=XXXXX" data-enable-live-updates="true" data-live-update-timeout="5000" data-allow-after-content-load="true"><script>
    ```

Example for the advanced installation option:

    ```lang-js
    // Rest of advanced script

    e.loadVIPExp("XXXXXXXX",{
    	allowAfterContentLoad: true
    })
    ```

## Content Security Policy (CSP)

If you use `script-src`, `content-src`, or `img-src` directives, update them to 
allow our domains:

    ```lang-php
    script-src 'self' https://experiments.parsely.com;
    img-src 'self' https://tr-experiments.parsely.com;
    content-src 'self' https://tr-experiments.parsely.com;
    ```

For the advanced installation snippet, ensure your CSP allows script execution. 
You can achieve this using a **nonce**, **hash**, or the `unsafe-inline` directive(
though the latter is generally not recommended).

    ```lang-php
    script-src 'self' 'unsafe-inline' https://experiments.parsely.com;
    ```

For more details, see [MDN: Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src#unsafe_inline_script).

## Disable Headline Testing

To disable Headline Testing, you can remove the JS snippet from your website. Once
the script is no longer loaded, no tests will be performed. 

The same applies if you would like to disable headline tests on specific pages. 
Tests will be performed and data gathered only where the script is loaded.

Last updated: July 06, 2026