From 257b1d7d7a628b7e8f17dd84efa5a6630fe84d0e Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 18 Jul 2018 13:12:48 -0400 Subject: [PATCH] stip guids from analytics page paths --- src/misc/analytics.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/misc/analytics.ts b/src/misc/analytics.ts index 37d665f72d6..5812821b2ee 100644 --- a/src/misc/analytics.ts +++ b/src/misc/analytics.ts @@ -104,6 +104,15 @@ export class Analytics { if (pagePath.indexOf('!/') === 0 || pagePath.indexOf('#/') === 0) { pagePath = pagePath.substring(1); } - return encodeURIComponent(pagePath); + const pathParts = pagePath.split('/'); + const newPathParts: string[] = []; + pathParts.forEach((p) => { + if (p.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)) { + newPathParts.push('__guid__'); + } else { + newPathParts.push(p); + } + }); + return encodeURIComponent(newPathParts.join('/')); } }