Skip to content

Commit 99d9a3a

Browse files
committed
Add identify back in
1 parent 400ad15 commit 99d9a3a

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/js/04-segment-analytics.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@
147147

148148
// Track page view on initial load once analytics is ready
149149
waitForAnalytics(() => {
150+
// Identify user with anonymous ID before tracking page
151+
if (window.SEGMENT_COMMON_PROPERTIES && window.SEGMENT_COMMON_PROPERTIES.userId) {
152+
window.analytics.identify(window.SEGMENT_COMMON_PROPERTIES.userId)
153+
}
150154
trackPage()
151155
})
152156

0 commit comments

Comments
 (0)