Skip to content

Commit 5fe3022

Browse files
committed
chore: remove sending user uuids to ga for better user distribution for seo flags
1 parent 799cb59 commit 5fe3022

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

src/desktop-metrics.html

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
}
1212

1313
const SAVED_GOOGLE_ANALYTICS_DESKTOP_KEY = "SAVED_GOOGLE_ANALYTICS_DESKTOP_KEY";
14-
const SAVED_CUSTOM_USER_ID_KEY = "SAVED_CUSTOM_USER_ID";
1514
let gaReady = false, loadedGoogleAnalyticsID;
16-
let savedCustomUserID = localStorage.getItem(SAVED_CUSTOM_USER_ID_KEY);
1715

1816
const url = window.location.href;
1917
const urlParams = new URLSearchParams(window.location.search);
@@ -92,11 +90,7 @@
9290
document.head.appendChild(gaScript);
9391

9492
gtag('js', new Date());
95-
const configParams = {};
96-
if (savedCustomUserID) {
97-
configParams.client_id = savedCustomUserID;
98-
}
99-
gtag('config', analyticsID, configParams);
93+
gtag('config', analyticsID);
10094
gaReady = true;
10195
}
10296

@@ -115,16 +109,6 @@
115109

116110
async function processRequest(event) {
117111
const payload = event.payload;
118-
if (payload.customUserID && payload.customUserID !== savedCustomUserID) {
119-
savedCustomUserID = payload.customUserID;
120-
localStorage.setItem(SAVED_CUSTOM_USER_ID_KEY, payload.customUserID);
121-
if (gaReady) {
122-
gtag('config', loadedGoogleAnalyticsID, {
123-
client_id: savedCustomUserID,
124-
send_page_view: false
125-
});
126-
}
127-
}
128112
if(payload.analyticsID && loadedGoogleAnalyticsID !== payload.analyticsID) {
129113
localStorage.setItem(SAVED_GOOGLE_ANALYTICS_DESKTOP_KEY, payload.analyticsID);
130114
installGoogleAnalytics();

0 commit comments

Comments
 (0)