For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Consent Mode in APP-SDK

The Google Consent Mode variables in JENTIS require a direct connection to the JENTIS DCP vendor configuration. Since app SDKs work only in one direction—sending data from the app SDK to JENTIS—we need to rewrite these variables specifically for the Google connectors. Below, we provide copy-and-paste code examples.

You can implement the according variables as custom variables in your configuration, so they fetch the consent based on the app-property-keys. Instead of how the defaults work (which are mapped to website parameter keys).

async function app_google_consent_default() {

    const config = {
        vendors: {
            ad_storage: ["adwords"],
            analytics_storage: ["google_analytics_4_server-side"],
            ad_user_data: ["adwords"],
            ad_personalization: ["adwords"]
        },
        toolConsents: (function(self) {
            var eventDoc = self.package.documents.filter(docs => docs.documentType === "event");
            return eventDoc[0].system.consent;
        })(this)
    };

    let googleConsentDefault = {
        toolConsents: {},
        consentStatus: {
            ad_storage: "",
            analytics_storage: "",
            ad_user_data: "",
            ad_personalization: ""
        },
        getConsentOfGCT: function(arrConfiguredVendors) {
            if (arrConfiguredVendors.length > 0) {
                var bConsent = "denied";
                for (var vendorsCnt = 0; vendorsCnt < arrConfiguredVendors.length; vendorsCnt++) {
                    var bVendorConsent = this.toolConsents[arrConfiguredVendors[vendorsCnt]];
                    if (bVendorConsent === true) {
                        bConsent = "granted";
                        break;
                    }
                }
                return bConsent;
            }
            return null;

        },
        set: function(config) {
            this.toolConsents = config.toolConsents;

            for (type in this.consentStatus) {
                this.consentStatus[type] = this.getConsentOfGCT(config.vendors[type]);
            }

        },
        prepare: function(config) {
            this.set(config);

            let ad_storage = (this.consentStatus.ad_storage === "granted") ? "r" : "q";
            let analytics_storage = (this.consentStatus.analytics_storage === "granted") ? "r" : "q";
            let ad_user_data = (this.consentStatus.ad_user_data === "granted") ? "r" : "q";
            let ad_personalization = (this.consentStatus.ad_personalization === "granted") ? "r" : "q";

            return `13${ad_storage}3${analytics_storage}P${ad_user_data}2${ad_personalization}5l1`;

        }
    };

    return googleConsentDefault.prepare(config);
}

Non Personalized Ads (npa)

Digital Market Act Parameter (dma_cps)

Last updated

Was this helpful?