Variables

This guide is a subset of the main TCFv2 GTM Implementation Guide specifically covering variables

If a user does NOT to import the json container provided in the GTM Implementation Guide, these GTM variables will need to be created manually. However, users SHOULD import (and merge) the sample container and all of the variables will be imported automatically.

Constant Variables

Variable: QCChoice - UTID

The QCChoice UTID variable is a constant that should be populated with your Quantcast Universal Tag ID. You can find your UTID by following the guide here.

Variable: QCChoice - DataLayer Push

The QCChoice - DataLayer Push variable is a constant that should be set to either true or false.  When true, this will enable functionality in the Custom HTML Tag that will automatically push user consent signals to DataLayer for consumption by Triggers to allow/block certain tags to fire.

Variable: QCChoice - CCPA

The QCChoice - CCPA variable is a constant that should be set to either true or false. When true, along with a valid QCChoice - CCPA msg id constant value set, the Choice CCPA message will be added to the website (You must also have CCPA enabled on the tag at quantcast.com).

Variable: QCChoice - CCPA msg id

The QCChoice - CCPA msg id variable is a constant that should be set to a string value. This value must be the HTML id of the container on the website where you want the CCPA footer message added.

Non-IAB Vendor Data Layer variables

Non-IAB Vendors must be defined in Quantcast.com; see the guide here on how to add non-IAB vendors. 

When the user opens the Quantcast Choice consent dialog, makes their decisions, and closes it, an object is pushed into the window.dataLayer array with details about what type of consent was given by the user with some other relevant information.

To use this metadata when creating and modifying the triggers for your Google Tag Manager tags, you need to create a couple of Data Layer variables in the Google Tag Manager user interface.

To create the following variables, go to the Variables section of the container by clicking the respective link in the left-hand side navigation of the container user interface. Scroll down to User-defined variables and click New. Repeat this for each of the variables you need to create.

Variable: nonIABVendorConsentIds

QC - __cmpConsents.nonIABVendorConsentIds, and its type is Data Layer variable.

Set the Data Layer Variable Name field to __cmpConsents.nonIABVendorConsentIds.

This variable returns a comma-separated string of all the non-IAB vendor IDs to which the user has consented (e.g. "1,32,101").

Variable: nonIABVendorsWithConsent

QC - __cmpConsents.nonIABVendorsWithConsent, and its type is Data Layer variable.

Set the Data Layer Variable Name field to __cmpConsents.nonIABVendorsWithConsent.

This variable returns a pipe-separated string of all the Non-IAB vendor names to which the user has given consent (e.g. "Facebook|Hotjar|Twitter").

IAB Vendor Data Layer variables

When the user opens the Quantcast Choice consent dialog, makes their decisions, and closes it, an object is pushed into the window.dataLayer array with details about what type of consent was given by the user with some other relevant information.

To use this metadata when creating and modifying the triggers for your Google Tag Manager tags, you need to create a couple of Data Layer variables in the Google Tag Manager user interface.

To create the following variables, go to the Variables section of the container by clicking the respective link in the left-hand side navigation of the container user interface. Scroll down to User-defined variables and click New. Repeat this for each of the variables you need to create.

Variable: iabVendorConsentIds

QC - __cmpConsents.iabVendorConsentIds, and its type is Data Layer variable.

Set the Data Layer Variable Name field to __cmpConsents.iabVendorConsentIds.

This variable returns a comma-separated string of all the IAB vendor IDs to which the user has consented (e.g. "1,3").

Variable: iabVendorsWithConsent

QC - __cmpConsents.iabVendorsWithConsent, and its type is a Data Layer variable.

Set the Data Layer Variable Name field to __cmpConsents.iabVendorsWithConsent.

This variable returns a pipe-separated string of all the IAB vendor names to which the user has consented (e.g. "My Custom AdTech Organization, Ltd.|AdMaster Inc.").

On This Page

Last Updated on: 06 Nov, 2023