Reply
Regular Visitor
Posts: 2
Registered: ‎11-06-2017
Accepted Solution

How to delete Cookie data from datalayer?

Hey,

is there a simple way to prevent Tealium from collecting First Party Cookie Data (e.g. Google Analytics or own Cookies) and sending it to e.g. EventStore?

Best,

Adrian

Reply
0 Kudos
VIP
Posts: 214
Registered: ‎01-04-2016

Re: How to delete Cookie data from datalayer?

Hi @Aberger - it's probably best to set that value to nothing (as in "") instead of trying to delete. 

Occasional Contributor
Posts: 125
Registered: ‎12-11-2015

Re: How to delete Cookie data from datalayer?

Most tags will only transmit the data that's explicitly mapped, so having cookie data in utag.data usually won't mean that it goes anywhere.

However, for any tags that do collect the entire data layer, a tag-scoped extension to blank out the values (as @mitchellt suggests) would be the best way. Create a JavaScript extension, scope it to the tags you need to remove cookie data from, and use the following code:

// For each UDO variable (k) within the event payload (b)
for(var k in b){
  // If the variable name starts "cp." then..
  if(typeof k === "string" && k.indexOf("cp.") === 0){
    // Set that variable to a blank string
    b[k] = "";
  }
}
Highlighted
Tealium Employee
Posts: 142
Registered: ‎09-01-2015

Re: How to delete Cookie data from datalayer?

@Aberger Good suggestions above.

1. Rather than set to "", I would suggest 

delete b['cp.xxx'];

to delete a specific cookie, or delete 

delete b[k];

 if using @UnknownJ's approach

This removes any reference to the cookie data in the data payload sent to the collect tag.

2. It is possible to send the cookie data to the UDH (for example to use in AudienceStream), but not have it sent onwards to EventDB, EventStore or EventStream.

The relevant event attributes could be marked as restricted in UDH.  They won't then be sent to EventStore unless explicitly configured to be.  https://community.tealiumiq.com//t5/Universal-Data-Hub/Understanding-Restricted-Data/ta-p/17773.  There is a separate checkbox to specify if the event attribute should go to EventDB, see screenshot.  As for EventStream, the UI will warn you if you choose a restricted attribute to send from an EventStream.

Tealium - Universal Data Hub 2018-06-26 21-21-21.png