Deployment

First you need a configuration for your CMP. You might use the example and modify that you can get one from Gravito Administration app. Put the config on your site:

<script>
var customCSS="";
var gravitoCMPConfig = {...}
window.gravitoCMPConfig = gravitoCMPConfig;
</script>

…and you can continue by implementing the CMP loading. Examples on this page should work either directly from page template or via Google Tag Manager custom HTML tag.

LightCMP as stand-alone version:

<script>
var gravitoSdkTag = document.createElement("script");
gravitoSdkTag.src = "https://cdn.gravito.net/sdk/gravitoSDK-v1.0.8.js";
gravitoSdkTag.onload = function () {
    window.gravito.ready(function () {
      gravito.initLightCMP(
        "https://cdn.gravito.net/lightcmp",
        "bundle_latest_2"
      );
    });
};
document.body.appendChild(gravitoSdkTag);
</script>

You can replace “bundle_latest_2” with the specific version you want to use, e.g. “bundle-2.0.5”. If you don’t pass any value or use above exmaple the config will use the latest version by default (recommended).

LightCMP with Google Consent Mode enabled:

<script>
var gravitoSdkTag = document.createElement("script");
gravitoSdkTag.src = "https://cdn.gravito.net/sdk/gravitoSDK-v1.0.7.js";
gravitoSdkTag.onload = function () {
   window.gravito.ready(function () {
      gravito.initLightCMPWithGCM(
         "https://cdn.gravito.net/lightcmp",
         "bundle_latest_2"
      );
   });
};
document.body.appendChild(gravitoSdkTag);
</script>

You can replace “bundle_latest_2” with the specific version you want to use, e.g. “bundle-2.0.5”. If you don’t pass any value or use above exmaple the config will use the latest version by default (recommended).

LightCMP with Gravito API integration (consents are stored to Gravito profile):

<script>
  var gravitoSdkTag = document.createElement("script");
  gravitoSdkTag.src = "https://cdn.gravito.net/sdk/gravitoSDK-v1.0.8.js";
  gravitoSdkTag.onload = function () {
    window.gravito.ready(function () {
      gravito.initLightCMPWithBackend(
        "https://cdn.gravito.net/lightcmp",
        "YOUR_GRAVITO_REGISTERED_DOMAIN",
        "bundle_latest_2"
      );
    });
  };
  document.body.appendChild(gravitoSdkTag);
</script>

NOTE: Make sure you have withBackendIntegration:true in gravitoCMPConfig

LightCMP with Google Consent Mode and Gravito API integration:

<script>
  var gravitoSdkTag = document.createElement("script");
  gravitoSdkTag.src = "https://cdn.gravito.net/sdk/gravitoSDK-v1.0.8.js";
  gravitoSdkTag.onload = function () {
    window.gravito.ready(function () {
      gravito.initLightCMPWithBackendandGCM(
        "https://cdn.gravito.net/lightcmp",
        "YOUR_GRAVITO_REGISTERED_DOMAIN",
        "bundle_latest_2"
      );
    });
  };
  document.body.appendChild(gravitoSdkTag);
</script>

NOTE: Make sure you have withBackendIntegration:true in gravitoCMPConfig