I would like to know what you think is the best Consent Logic for SST & Data Tag.
Situation:
I am about to configure Consent logic in my Server Container.
On server, I have a Event Data Variable (marketing consent → granted / denied)
Question
Stape Server Tags offer a consent Setting eg Send data in case marketing consent given
I would like to use and control this Consent Settings, as it is easier than duplicate all triggers or use trigger as exception.
Can I send this Data Object with GA4 aswell, to make use of the built in Consent Settings of the Stape Plugins? Or else, can I reconstruct the same consent object, the Data Tag would send?
Is there an even better approach for implementing consent without making it as ugly and complicated as in the old days? (with custom trigger for each consent state)
In order for this to work - you need your consent banner to support GCM, in this case if you activate this option - along with the event data the consent state at the moment the tag is running will also be transmitted.
thank you for your answer, but I asked something completely different.
I am NOT talking about Consent Management on Client side, this is all set. Don’t worry about it.
Those are my questions:
I already found my answer by looking into the Code of your Server Tags:
The consent settings primarily revolve around the function isConsentGivenOrNotRequired(), which checks whether consent is provided or if it is not required. The key points for consent handling are:
Storage Consent Check (adStorageConsent):
If adStorageConsent is not required (data.adStorageConsent !== 'required'), the function returns true, meaning no consent is required, and data processing can proceed.
If consent is required, it checks the eventData.consent_state object to verify if ad_storage consent has been granted (!!eventData.consent_state.ad_storage).
Fallback Check for Google Consent Mode (x-ga-gcs):
The function also checks a specific string (x-ga-gcs), where the third character (index 2) represents the consent status for Google’s consent mode. If this character is ‘1’, consent is given; otherwise, it is not.
Behavior Based on Consent:
If consent is not provided, the process terminates early, returning data.gtmOnSuccess() without further action.
If consent is provided or not required, the tag proceeds with data collection, cookie setting, and sending requests to the API.
Thus, the function ensures that data processing and tracking only occur when consent has been granted or is not necessary based on the configured settings.
Yes, on a web container you can do this with a custom js variable. On the server you need to create your own custom variable that will take the required parameter (or look for the required key in event data) and do JSON.parse for it.