Skip to content

Commit edb2a4d

Browse files
committed
fix: sync user attributes to CT
1 parent 0261411 commit edb2a4d

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/MigrationManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export default class MigrationManager {
142142
Object.assign(attrs, { Identity: userId })
143143
clevertap.onUserLogin.push({ Site: attrs })
144144
} else {
145-
clevertap.profile.push(attrs)
145+
clevertap.profile.push({ Site: attrs })
146146
}
147147
}
148148

test/specs/MigrationManager.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,11 @@ describe(MigrationManager, () => {
249249

250250
expect(clevertap.profile.push).toHaveBeenCalledTimes(1)
251251
expect(clevertap.profile.push).toHaveBeenCalledWith({
252-
age: 42,
253-
interests: '[jumping,running]'
252+
Site: {
253+
age: 42,
254+
interests: '[jumping,running]',
255+
'tz': expect.any(String)
256+
}
254257
})
255258
})
256259

@@ -268,7 +271,10 @@ describe(MigrationManager, () => {
268271

269272
expect(clevertap.profile.push).toHaveBeenCalledTimes(1)
270273
expect(clevertap.profile.push).toHaveBeenCalledWith({
271-
'ct-name1': 'foo'
274+
Site: {
275+
'ct-name1': 'foo',
276+
'tz': expect.any(String)
277+
}
272278
})
273279
})
274280

0 commit comments

Comments
 (0)