Skip to content

isGrantedPersonalizationStorage — GTM Variable Template for GTM

VARIABLES › GTM
isGrantedPersonalizationStorage EXTENDED GTM

Returns true if the consent type personalization_storage is granted.


GTM Configuration

This is what you'll see when you open this variable in Google Tag Manager.

Read-only Preview
isGrantedPersonalizationStorage
This function takes no parameters.


Under the Hood

📜 View Implementation Code
/**
 * Checks if consent is granted for personalization storage.
 * 
 * @returns {boolean} True if personalization storage consent is granted, false otherwise.
 *
 * @framework ggLowCodeGTMKit
 */
const isConsentGranted = require('isConsentGranted');

return isConsentGranted('personalization_storage');


___WEB_PERMISSIONS___

[
  {
    "instance": {
      "key": {
        "publicId": "access_consent",
        "versionId": "1"
      },
      "param": [
        {
          "key": "consentTypes",
          "value": {
            "type": 2,
            "listItem": [
              {
                "type": 3,
                "mapKey": [
                  {
                    "type": 1,
                    "string": "consentType"
                  },
                  {
                    "type": 1,
                    "string": "read"
                  },
                  {
                    "type": 1,
                    "string": "write"
                  }
                ],
                "mapValue": [
                  {
                    "type": 1,
                    "string": "personalization_storage"
                  },
                  {
                    "type": 8,
                    "boolean": true
                  },
                  {
                    "type": 8,
                    "boolean": false
                  }
                ]
              }
            ]
          }
        }
      ]
    },
    "clientAnnotations": {
      "isEditedByUser": true
    },
    "isRequired": true
  }
]