Data privacy and user consent

mPulse uses cookies to collect website performance data and sends and stores this data to remote servers. If you use either edge or origin injection, the mPulse Consent Loader Wrapper helps you comply with data privacy laws and regulations, and give your visitors the option to opt in or opt out of data collection.

The mPulse Consent Loader Wrapper is an optional feature that can integrate with any cookie consent library deployed on your website. It uses Boomerang, the JavaScript library that collects and sends data to mPulse, to load and send beacons.

If you’re using mPulse with origin injection, the mPulse Consent Loader Wrapper gives you additional control over the loader’s execution. Some mPulse customers wrap the mPulse origin injection loader directly inside their cookie consent solution, in which case they may not need the mPulse Consent Loader Wrapper.

When deployed, the Consent Loader Wrapper is in opt-out mode by default, meaning Boomerang won’t load or send beacons until a visitor explicitly opts in.

What happens when you opt in or opt out

The mPulse Consent Loader Wrapper uses different callback functions depending on whether the visitor opts in to or opts out of mPulse. You need to set up your cookie consent solution to use these callback functions.

Boomerang performs a separate set of actions based on the visitor’s selection:

SelectionWhat happensCallback function
Opt in to mPulseBoomerang doesn’t load and beacons aren’t sent to mPulse until the visitor chooses to opt in.window.BOOMR_CONSENT_WRAPPER_OPT_IN()
Opt out of mPulseIf a visitor previously opted in, Boomerang sends beacons, uses cookies, and makes other requests to mPulse domains until the visitor opts out.window.BOOMR_CONSENT_WRAPPER_OPT_OUT()

Opt out (default)

By default, the mPulse Consent Loader Wrapper is in opt-out mode. Requests to mPulse aren’t sent and mPulse-related cookies aren’t created until a visitor opts in through a cookie consent solution.

Your cookie consent platform solution needs to call window.BOOMR_CONSENT_WRAPPER_OPT_OUT() when a visitor who initially opted in and decides to opt out. In this case, calling window.BOOMR_CONSENT_WRAPPER_OPT_OUT() deletes all Boomerang-related cookies, and stops Boomerang from sending beacons to mPulse.

Actions when you opt out

The following data applies for the opt-out option:

Already opted inAfter opt-out
Boomerang loaded from *.go-mpulse.net domainYesNo
Boomerang configuration requested from *.go-mpulse.net domainYesNo
Beacons sent to mPulse *.akstat.io domainYesNo
First-party Request tracker (RT) cookieYesNo
First-party Bandwidth (BW) cookieYesNo

Opt in

Your cookie consent platform solution needs to call window.BOOMR_CONSENT_WRAPPER_OPT_IN() when a visitor:

  • Chooses to opt in.
  • Navigates to a new page after already choosing to opt in.

Before your visitors can opt in to sending data to mPulse, integrate your site’s cookie consent platform solution with the mPulse Consent Loader Wrapper. For steps, see Add the Consent Load Wrapper to your cookie consent solution or Upgrade the Consent Inline Plugin to the Consent Load Wrapper.

Actions when you opt in

The following data applies for the opt-in option:

Already opted inAfter opt-out
Boomerang loaded from *.go-mpulse.net domainNoYes
Boomerang configuration requested from *.go-mpulse.net domainNoYes
Beacons sent to mPulse *.akstat.io domainNoYes
First-party Request tracker (RT) cookieNoYes
First-party Bandwidth (BW) cookieNoYes

Set up edge injection

If your Akamai property already has mPulse edge injection, you have to set up the callbacks in your cookie consent platform before configuring the mPulse Consent Loader Wrapper. If you don’t set up the callbacks first, you may experience gaps in mPulse data.

Enabling the wrapper introduces a loader that prevents Boomerang from loading until window.BOOMR_CONSENT_WRAPPER_OPT_IN() is called.

For edge injection, you need to set a PMUSER_ variable in Property Manager.

In both scenarios, all changes will activate only after calling a JavaScript function for the opt-in or opt-out procedure.

If you use mPulse with edge injection, set the PMUSER_MPULSE_CONSENT_WRAP variable to true in Property Manager. Once the property is configured, the opt-in and opt-out callbacks will be available for your cookie consent solution:

  1. Verify that the callbacks are set up in your cookie consent platform.

  2. Go to Property Manager, and choose the property you want to configure from the list.

  3. In the Property Variables tab, click Add variables and set the required mPulse Consent Wrapper variable:

    • In Variable Name, enter PMUSER_MPULSE_CONSENT_WRAP.

    • Set the Initial Value to true.

    • Enter a Description, for example, Enable mPulse Consent Wrapper.

    • Set the Security Settings to Hidden.

  4. Click Save.

  5. Back on the list of properties, open the three-dot Action menu next to your property, then click Activate.

Set up origin injection

Some customers may prefer origin injection because it fits better with their instrumentation or because they are mPulse Akamai customers who do not use Akamai for edge delivery.

For origin injection, you will need to deploy the mPulse Consent Loader Wrapper JavaScript code manually on your website.

In both scenarios, all changes will activate only after calling a JavaScript function for the opt-in or opt-out procedure.

Some mPulse customers wrap the mPulse origin injection loader directly inside their cookie consent solution, in which case they may not need the mPulse Consent Loader Wrapper.

Minified origin injection

Alternatively, customers can add a minified origin injection version of the mPulse Consent Loader Wrapper to their HTML or JavaScript files. This allows for manual instrumentation of the callbacks from within a cookie consent solution.

To implement this, the customer will need to replace the string "MPULSE API KEY PLACEHOLDER - SET THE API KEY HERE" in the minified code with their mPulse API key, which can be found in the mPulse App editor.

!function(e){if(e.MPULSE_API_KEY="MPULSE API KEY PLACEHOLDER - SET THE API KEY HERE",!e.BOOMR||!e.BOOMR.version&&!e.BOOMR.snippetExecuted){var n={v:"1",cookieNames:["RT","BA"],injected:!1,removeCookie:function(n){if(e.BOOMR&&e.BOOMR.utils&&"function"==typeof e.BOOMR.utils.removeCookie)e.BOOMR.utils.removeCookie(n)},removeAllCookies:function(){for(var e=0;e<this.cookieNames.length;e++)this.removeCookie(this.cookieNames[e])},loadBoomerang:function(){!function(){function e(){if(!d){var e=document.createElement("script");e.id="boomr-scr-as",e.src=window.BOOMR.url,e.async=!0,i.appendChild(e),d=!0}}function n(e){d=!0;var n,t,o,a,r=document,s=window;if(window.BOOMR.snippetMethod=e?"if":"i",t=function(e,n){var t=r.createElement("script");t.id=n||"boomr-if-as",t.src=window.BOOMR.url,BOOMR_lstart=(new Date).getTime(),e=e||r.body,e.appendChild(t)},!window.addEventListener&&window.attachEvent&&navigator.userAgent.match(/MSIE [678]\\./))return window.BOOMR.snippetMethod="s",void t(i,"boomr-async");o=document.createElement("IFRAME"),o.src="about:blank",o.title="",o.role="presentation",o.loading="eager",o.id="boomr-if",a=(o.frameElement||o).style,a.width=0,a.height=0,a.border=0,a.display="none",(r.body||i).appendChild(o);try{s=o.contentWindow,r=s.document.open()}catch(O){n=document.domain,o.src="javascript:var d=document.open();d.domain='"+n+"';void 0;",s=o.contentWindow,r=s.document.open()}if(s._boomrl=function(){t()},s.addEventListener)s.addEventListener("load",s._boomrl,!1);else if(s.attachEvent)s.attachEvent("onload",s._boomrl);r.close()}function t(e){window.BOOMR_onload=e&&e.timeStamp||(new Date).getTime()}if(!window.BOOMR||!window.BOOMR.version&&!window.BOOMR.snippetExecuted){window.BOOMR=window.BOOMR||{},window.BOOMR.snippetStart=(new Date).getTime(),window.BOOMR.snippetExecuted=!0,window.BOOMR.snippetVersion=16,window.BOOMR.url="https://s.go-mpulse.net/boomerang/"+window.MPULSE_API_KEY;var o=document.currentScript||document.getElementsByTagName("script")[0],i=o.parentNode,d=!1,a=window.BOOMR_loader_timeout||3e3,r=document.createElement("link");if(r.relList&&"function"==typeof r.relList.supports&&r.relList.supports("preload")&&"as"in r)window.BOOMR.snippetMethod="p",r.href=window.BOOMR.url,r.rel="preload",r.as="script",r.addEventListener("load",e),r.addEventListener("error",function(){n(!0)}),setTimeout(function(){if(!d)n(!0)},a),BOOMR_lstart=(new Date).getTime(),i.appendChild(r);else n(!1);if(window.addEventListener)window.addEventListener("load",t,!1);else if(window.attachEvent)window.attachEvent("onload",t)}}()},grantConsent:function(){if(!this.injected)this.injected=!0,this.loadBoomerang()},denyConsent:function(){if(this.removeAllCookies(),e.BOOMR&&"function"==typeof e.BOOMR.disable)e.BOOMR.disable()}};e.BOOMR_CONSENT_WRAPPER_VERSION=n.v,e.BOOMR_CONSENT_WRAPPER_OPT_IN=function(){n.grantConsent()},e.BOOMR_CONSENT_WRAPPER_OPT_OUT=function(){n.denyConsent()}}}(window);

Add the Consent Load Wrapper to your cookie consent solution

Once you set up either edge or origin injection, you need to add JavaScript to your cookie consent solution. This JavaScript should detect the visitor’s current decision and the presence of the Consent Load Wrapper.

To prevent JavaScript errors if the Consent Loader Wrapper is not yet active or instrumented, callbacks check for window.BOOMR_CONSENT_WRAPPER_VERSION.

Normally cookie consent solutions provide a callback function where you can instrument the opt in and opt out functions of analytics solutions like mPulse.

Example code

Here’s a code sample for cookie consent solutions that demonstrates how to detect the visitors' consent choice and to call the mPulse Consent Loader Wrapper.

This code is backward compatible, which means your site continues to work after injecting the code without JavaScript errors occurring before you deploy the new property version with the Consent Loader Wrapper enabled.

function getCurrentDecision(performanceConsented) {

    // Detects activate mPulse consent wrapper logic
    if (window.BOOMR_CONSENT_WRAPPER_VERSION) {
        if (performanceConsented) {
            window.BOOMR_CONSENT_WRAPPER_OPT_IN();
        } else {
            window.BOOMR_CONSENT_WRAPPER_OPT_OUT();
        }
    }
}

Upgrade the Consent Inline Plugin to the Consent Load Wrapper

If your site already uses the mPulse Consent Inline Plugin for site visitors to opt in or opt out from data collection, you can upgrade the Consent Load Wrapper. This procedure is designed for backward compatibility, which prevents mPulse data loss and JavaScript errors from occurring on your site.

Update your cookie consent solution logic to include Consent Load Wrapper callbacks, modify variables in Property Manager (for mPulse edge injection only), and remove callbacks referring to Consent Inline Plugin.

šŸ“˜

Tip

After adding the JavaScript code for the Consent Load Wrapper callbacks and updating Property Manager variables, make sure the new cookie consent logic is running smoothly.

You can:

  • Browse the site manually to check if the content loads as expected.
  • Confirm opt-in and opt-out works as expected after the Consent Load Wrapper is added.
  • Check the mPulse dashboard for any anomalies.

Wait at least a few hours after each step before removing the Consent Inline Plugin callbacks.

Add Consent Load Wrapper callbacks

Update your cookie consent solution logic to include both the existing Consent Inline Plugin callbacks (window.BOOMR_OPT_IN() and window.BOOMR_OPT_OUT()), and the new callbacks for the Consent Load Wrapper (window.BOOMR_CONSENT_WRAPPER_OPT_IN() and window.BOOMR_CONSENT_WRAPPER_OPT_OUT()) in the source code of your site (either HTML or JavaScript).

This step ensures mPulse keeps receiving data even if the Consent Load Wrapper isn’t fully enabled yet. The new mPulse consent wrapper logic is activated by checking for window.BOOMR_CONSENT_WRAPPER_VERSION.

Example code

Here’s a code sample for cookie consent solutions that demonstrates how to detect the visitors' consent choice and to call the mPulse Consent Loader Wrapper.

This code is backward compatible, which means your site continues to work after injecting the code without JavaScript errors occurring before you deploy the new property version with the Consent Loader Wrapper enabled.

// NOTE: The mechanism for calling this function and determining the 'isPerformanceConsented' 
// value must be implemented using your specific Consent Management Platform (CMP) logic.
// This is an example of the callback logic only.

// Function that executes when the user provides or updates their consent decision.
function handleConsentDecision(isPerformanceConsented) { 

    // isPerformanceConsented is a boolean (true/false) indicating if the 
    // user has granted consent for Performance/Analytics cookies.
    
    // Fallback while activating consent wrapper logic (Consent Inline Plugin)
    if (window.BOOMR_CONSENT_CONFIG) {
        if (isPerformanceConsented) {
            window.BOOMR_OPT_IN();
        } else {
            window.BOOMR_OPT_OUT();
        }
    }

    // Activate mPulse consent wrapper logic
    if (window.BOOMR_CONSENT_WRAPPER_VERSION) {
        if (isPerformanceConsented) {
            window.BOOMR_CONSENT_WRAPPER_OPT_IN();
        } else {
            window.BOOMR_CONSENT_WRAPPER_OPT_OUT();
        }
    }
}

Update the property variables

For mPulse edge injection, moving from the Consent Inline Plugin to the Consent Load Wrapper requires changing the PMUSER_ variables in Property Manager.

Remove the Consent Inline Plugin variables before adding required variables for the Consent Load Wrapper and activating the property. This step activates the new wrapper logic for edge injection users.

šŸ“˜

Tip

This step is required only for users with mPulse edge injection.

To avoid data loss and JavaScript errors occurring on your site, add the Consent Load Wrapper callbacks to your cookie consent solution before updating the property variables.

  1. Verify that the callbacks are set up in your cookie consent platform.

  2. Go to Property Manager, and choose the property you want to configure from the list.

  3. In the Property Variables tab, remove the Consent Inline Plugin’s PMUSER_MPULSE_CONSENT and PMUSER_MPULSE_CONSENT_OPT_REQ variables from the configuration.

  4. In the Property Variables tab, click Add variables and set the required mPulse Consent Wrapper variable:

    • In Variable Name, enter PMUSER_MPULSE_CONSENT_WRAP.
    • Set the Initial Value to true.
    • Enter a Description, for example, Enable mPulse Consent Wrapper.
    • Set the Security Settings to Hidden.
  5. Click Save.

  6. Back on the list of properties, open the three-dot Action menu next to your property, then click Activate.

  7. Wait at least a few hours after activating the property with the changes to make sure the cookie consent solution is running smoothly.

Remove the Consent Inline Plugin callbacks

After the new Consent Load Wrapper callbacks and property variables (for edge injection only) have been live for a short test period, you can safely remove the deprecated Consent Inline Plugin callbacks from your cookie consent solution.

Look for the window.BOOMR_CONSENT_CONFIG object in the source code of your site (either HTML or JavaScript), remove it, and re-deploy the cookie consent solution.

Example code

// Fallback while activating consent wrapper logic
if (window.BOOMR_CONSENT_CONFIG) {
 if (performanceConsented) {
 window.BOOMR_OPT_IN();
 } else {
 window.BOOMR_OPT_OUT();
 }
}

Did this page help you?