Didomi-mParticle integration for your CMP

How It Works

Thanks to the Didomi-mParticle integration, you will be able to collect consent data and push it to mParticle. At the same time, user consent data will continue streaming to Didomi via the Didomi SDK.

  • mParticle SDK is initialized → and will automatically initialize the Didomi SDK → the consent notice is then displayed on your website

  • Once the user provides/updates their consent on the Didomi consent notice, the consent data will be streamed:

    • To the Didomi server via the Didomi SDK

    • To the mParticle server via the mParticle SDK

Implementation

The Didomi-mParticle integration can be set up in 3 main steps:

1- Add the mParticle SDK

More documentation here: https://docs.mparticle.com/developers/quickstart/web/overview/

Add the mParticle SDK right below the opening <head> in your webpage’s HTML. Don’t forget to replace the API key as indicated in the script.

<script type="text/javascript">

// Configures the SDK. Note the settings below for isDevelopmentMode
// and logLevel.

window.mParticle = {
  config: {
    isDevelopmentMode: true,
    logLevel: "verbose"
  },
};

// Insert your API key below
(function(t){window.mParticle=window.mParticle||{};window.mParticle.EventType={Unknown:0,Navigation:1,Location:2,Search:3,Transaction:4,UserContent:5,UserPreference:6,Social:7,Other:8};window.mParticle.eCommerce={Cart:{}};window.mParticle.Identity={};window.mParticle.config=window.mParticle.config||{};window.mParticle.config.rq=[];window.mParticle.config.snippetVersion=2.3;window.mParticle.ready=function(t){window.mParticle.config.rq.push(t)};var e=["endSession","logError","logBaseEvent","logEvent","logForm","logLink","logPageView","setSessionAttribute","setAppName","setAppVersion","setOptOut","setPosition","startNewSession","startTrackingLocation","stopTrackingLocation"];var o=["setCurrencyCode","logCheckout"];var i=["identify","login","logout","modify"];e.forEach(function(t){window.mParticle[t]=n(t)});o.forEach(function(t){window.mParticle.eCommerce[t]=n(t,"eCommerce")});i.forEach(function(t){window.mParticle.Identity[t]=n(t,"Identity")});function n(e,o){return function(){if(o){e=o+"."+e}var t=Array.prototype.slice.call(arguments);t.unshift(e);window.mParticle.config.rq.push(t)}}var dpId,dpV,config=window.mParticle.config,env=config.isDevelopmentMode?1:0,dbUrl="?env="+env,dataPlan=window.mParticle.config.dataPlan;dataPlan&&(dpId=dataPlan.planId,dpV=dataPlan.planVersion,dpId&&(dpV&&(dpV<1||dpV>1e3)&&(dpV=null),dbUrl+="&plan_id="+dpId+(dpV?"&plan_version="+dpV:"")));var mp=document.createElement("script");mp.type="text/javascript";mp.async=true;mp.src=("https:"==document.location.protocol?"<https://jssdkcdns>":"<http://jssdkcdn>")+".mparticle.com/js/v2/"+t+"/mparticle.js" + dbUrl;var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(mp,c)})
("<REPLACE WITH API KEY>");

</script>

2- Add the Didomi SDK

Insert the Didomi SDK right below the mParticle SDK. More documentation on Didomi’s Web SDK can be found in this developer documentation.

3- Enable and Configure the integration in mParticle

Set up the Didomi Integration

  1. Login to your mParticle app

  2. Navigate to Directory → Didomi

  3. Click Setup → this will create your Event output for Didomi.

Configure the Didomi-mParticle connection

  1. Navigate to Connections → connect

  2. Choose your input: JS Web

  3. Click Connect Output

  4. Choose your output: Didomi integration

  5. Select a configuration from the list and click Next:

  6. Connect Didomi-mParticle data transfer: select the mParticle purposes created earlier and map them to their corresponding Didomi purposes. Didomi purposes will be referenced thanks to the purpose SDK ID (from the Didomi console)

  7. Remove mapping for the other types of data (vendors)

  8. Click “Add connection”

Last updated