19. data-analytics-* footprint (XPath)
(function(){
var matches = document.evaluate(
"//@*[starts-with(name(),'data-analytics-')]",
document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
null
);
var i = matches.snapshotLength;
while(i--) console.log(matches.snapshotItem(i));
})();
@albangerome
20. DOM Mutations
new MutationObserver(function(mutations){
if(a = mutations.filter(function(mutation){
return !!mutation.target.dataset.analyticsPageviewDescription;
})){
console.log(a[0]); //returns the DOM element with the page name
};
}).observe(
document.body, {
subtree : !0,
attributes : !0
}
);
@albangerome
26. • Expected: 971003a4fe4fe8596cee02d4192459e3
• Before release: 6997729ea6c3a9896f6931a40d97b726
Mismatching hashes at build time tells
the devs that they might have broken
the analytics implementation
Hashes and page names
@albangerome
27.
28.
29. What’s still missing
• Cookies to be handled server-side
• Generate the hashes server-side
• Modules bundling done server-side
• Idle until urgent
• Full TypeScript rewrite, transpile to WASM
• Anything else, you tell me!
@albangerome