Closed lamrowena closed 1 year ago
with the parsedSection(s) (singular or plural?) object in there, we can adjust the last example to this:
if (__gpp)
{
__gpp('addEventListener', function (evt, success)
{
//callback will receive all events, we only want to react on signalStatus ready events
if (evt.eventName !== 'signalStatus' || evt.data !== 'ready')
{return;}
//if only the GPP String is needed, it can be taken directly from pingData.gppString
var gppString = evt.pingData.gppString;
//get the data from the TCF Canada section
//Note: You might also want to check if Canda is in the pingData.applicableSections
if ('tcfcav1' in evt.pingData.parsedSections)
{
var data = evt.pingData.parsedSections.tcfcav1;
var vendorConsent = data[0].VendorExpressConsent;
var vendorImpConsent = data[0].VendorImpliedConsent;
var purposeConsent = data[0].PurposesExpressConsent;
// ... do something Canadian !
}
});
}