Kermit

This the third and last part of a 3 part article on Kermit. Please read part one 1 there: Kermit - part 1 and part 2 there: Kermit - part 2

Checksums for peace

Several years ago I inherited a rather lopsided Adobe Analytics implementation where about a quarter million web pages shared a single page name. Analysing user journeys was impossible, and I was searching for a way to give them a unique page name. I did not want to rely on any part of the URL, and I could not rename them all manually. The answer was staring me in the face when I saw that Adobe Analytics provided an MD5 checksum for specific types of files. Several people have implemented MD5 in Javascript; suddenly I could give a 32-character unique page name to all the web pages. A developer got confused and put live the experimental version of my Adobe Analytics library file containing the MD5 algorithm. In one fell swoop, he gave a unique page name to all pages without as much as a security team review. This file broke none of the incumbent reports, so it remained live.

Whenever a web page used the data-analytics-pageview-description HTML5 attribute but without value, Kermit would use an MD5 hash of all its child nodes and use this as a temporary but unique page name. Another computer would calculate the same hash consistently but should the page HTML change by as little as a space added or removed the hash would change again. Kermit now also uses MD5 to generate a checksum for all page views and all page element interactions. You can use these checksums inside your regression tests. Whenever your developers changed your code the new checksum may no longer match the original one, it may even be missing altogether. The regression tests should then throw a warning, or even an error before the modified code even goes live.

The MD5 hashes were very helpful but not strictly necessary. I started work on a module system, and MD5 became one the first Kermit modules. I also looked into ways to add lookups. A single data- attribute could contain a lookup key, and the core Kermit library could contain or load a module containing the lookup data. At that stage, Kermit only recognised a minimal and strict set of data- attributes. I added support for arbitrary data- attributes starting with data-analytics-pageview-attribute- and data-analytics-interaction-attribute-. Kermit also only detected three Javascript events: click, change and blur. I added data-analytics-interaction-event to support other event types.

Cookie explicit and implicit consent

In Europe, the data protection laws are no trifling matter. We must ask the consent of our customers on their first visit whether we may drop cookies on their device by displaying a one-time message. The page may also contain other page elements of importance. When a visitor interacts with such an element, we may consider that this constitutes an implicit form of consent and the one-time message disappears all the same. This seems like a data-analytics-interaction-consent-implicit attribute might just do the job. It does not even need a value. I believe that a website should not track a visitor until it has obtained their consent to be tracked.

Demo links