mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #32376 from overleaf/rh-cio-migrate-identifiers
Replace analytics id with user id as main identifier in customer.io GitOrigin-RevId: 780671a51b652c73a940bc152d8fd6916dd611ce
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
if(customerIoEnabled && ExposedSettings.cioWriteKey && ExposedSettings.cioSiteId)
|
||||
script(type="text/javascript", id="cio-loader", nonce=scriptNonce, data-cio-write-key=ExposedSettings.cioWriteKey, data-cio-site-id=ExposedSettings.cioSiteId, data-session-analytics-id=getSessionAnalyticsId()).
|
||||
script(type="text/javascript", id="cio-loader", nonce=scriptNonce, data-cio-write-key=ExposedSettings.cioWriteKey, data-cio-site-id=ExposedSettings.cioSiteId, data-session-analytics-id=getSessionAnalyticsId(), data-user-id=((user && user._id) || '')).
|
||||
var cioSettings = document.querySelector('#cio-loader').dataset;
|
||||
var analyticsId = cioSettings.sessionAnalyticsId;
|
||||
var userId = cioSettings.userId;
|
||||
var siteId = cioSettings.cioSiteId;
|
||||
var writeKey = cioSettings.cioWriteKey;
|
||||
|
||||
@@ -19,6 +20,8 @@ if(customerIoEnabled && ExposedSettings.cioWriteKey && ExposedSettings.cioSiteId
|
||||
);
|
||||
if (analyticsId) {
|
||||
analytics.setAnonymousId(analyticsId);
|
||||
analytics.identify(analyticsId);
|
||||
}
|
||||
if (userId) {
|
||||
analytics.identify(userId);
|
||||
};
|
||||
}}();
|
||||
|
||||
Reference in New Issue
Block a user