Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

DTM Cookie Improvements

Avatar

Avatar
Boost 5
Level 2
adam_haining
Level 2

Likes

17 likes

Total Posts

12 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 2
adam_haining
Level 2

Likes

17 likes

Total Posts

12 posts

Correct Reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
adam_haining
Level 2

11-06-2016

DTM has the ability to write cookies using the _satellite.setCookie function.  However, there are a few problems with how they currently function, and it requires some work arounds to get it to work properly for some websites.  Here are the items that need to be changed:

  • Cookie names can be written with a space in the name, or other invalid or undesired values.  This is especially possible when a data element is set to persist for a visit or visitor.  The cookie names should be encoded so this will no longer occur.  There are some servers that will throw errors on any request where this occurs, so it is best to avoid this.
  • Cookie values are not encoded.  This can cause a few different problems.  First, if the cookie contains a semicolon, it'll break how the cookie is stored and the cookie will not have the correct settings.  Next, some servers can throw errors if cookies contain non-encoded values, especially for any multibyte or special characters.
  • The cookies are ALWAYS set on the subdomain, there is no option to set them on the root domain.  This prevents DTM from being able to set a root domain cookie that will span across subdomains to really harness the power of cookies.
  • Have an option to group cookies, similar to the Adobe Analytics cookie combining utility.  This will allow DTM to still set cookies, but limit it to just 2 cookies if possible (one for session and one for persistent).  The number of cookies on certain websites needs to be reduced, and DTM cookies can compound the issue.
1 Comment

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct Reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
joshd7227840
MVP

05-08-2016

Agreed.  DTM's cookie handling methods are terrible. 

 

Currently I include this library in DTM 

 

https://github.com/js-cookie/js-cookie

 

And then I do this:

 

_satellite._cookies = Cookies.noConflict();

 

 

And then use _satellite._cookies methods to read/write cookies.  Doesn't solve for combined cookie functionality, but it's certainly better than DTM's limited methods.