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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

DTM Cookie Improvements

Avatar

Avatar
Give Back 3
Level 2
adam_haining
Level 2

Likes

17 likes

Total Posts

12 posts

Correct reply

1 solution
Top badges earned
Give Back 3
Give Back
Boost 5
Boost 3
Boost 10
View profile

Avatar
Give Back 3
Level 2
adam_haining
Level 2

Likes

17 likes

Total Posts

12 posts

Correct reply

1 solution
Top badges earned
Give Back 3
Give Back
Boost 5
Boost 3
Boost 10
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
Ignite 3
Level 9
Josh_Du
Level 9

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Ignite 3
Ignite 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Ignite 3
Level 9
Josh_Du
Level 9

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Ignite 3
Ignite 1
Give Back 100
Give Back 50
Give Back 25
View profile
Josh_Du
Level 9

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.