Custom Cookie Consent


PathFactory is able to integrate with external cookie consent providers. These may be custom solutions built by your organization, or a cookie consent provider you have purchased.

How does this work?

PathFactory allows 3rd party cookie consent providers to manage the PathFactory vid persistent cookie on a Content Track by providing a set of functions that can be executed within a Content Track. Working in conjunction with the scripts from your consent provider, these functions can determine the current status of cookie consent of a visitor and set the consent status of a visitor.

Don’t have an external cookie consent provider? Use PathFactory’s built-in cookie consent function!

  1. Select Organization Settings from the drop-down menu under your username.

    You must be an admin user to access Organization Settings.


  2. Click the Cookie Consent tab, then select Enable Custom Cookie Consent.

  3. In the text box, enter scripts from your consent provider in conjunction with PathFactory consent functions.

    See the Code Samples below on how to use setPfConsent() and pfConsentStatus() with a 3rd party consent provider.


  4. (Optional) Check Apply Cookie Consent to all new tracks.

    This ensures that all new Content Tracks created after this point will automatically have Cookie Consent toggled on. If you do not select this option, you will have to manually toggle on Cookie Consent for individual Content Track.


Code Sample: Generic Implementation

If you are using a custom cookie consent implementation on your website, you can use the function below to interact with PathFactory’s consent settings.
Your consent provider scripts should request tracking consent from the visitor and pass the result to the setPfConsent function.

 //Add the script for your consent provider here  function setPfConsent(status){ if(pfConsentStatus()!=true &&status==true)     return pfCookieResponse(true); if (pfConsentStatus() != false && status==false)     pfCookieResponse(false); }  pfOnJukeboxLoad.then(function() {  //run consent functions here.  If your consent manager returns true, run setPfConsent(true), if it returns false, run setPfConsent(false)  });

Code Sample: TrustArc Implementation

The TrustArc script contains 2 parts.
First, PathFactory checks consent from TrustArc when the Content Track loads.
PathFactory then adds a listener to check again if a visitor updates their preferences in TrustArc on the Content Track.
We are getting the visitor’s consent status from the notice_gdpr_prefs cookie dropped by TrustArc.

Add the following scripts to the text area in the Cookie Consent configuration section:


Code Sample: CookiePro Implementation

The CookiePro script dynamically updates script tags in the HTML tied to the different cookie categories. Simply add the script tag below along with the CookiePro banner script. When the visitor has consented to being tracked, the script tag’s type will change from text/plain to JavaScript and the PathFactory opt-in will execute.

Add the following scripts to the text area in the Cookie Consent configuration section:


In order for these cookie consent scripts to execute, a Content Track must have Cookie Consent toggled On.

Updated on July 10, 2022

Was this article helpful?

Need Support?
Can't find the answer you're looking for? Don't worry we're here to help!