-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
I'm running into problems when tracking users across subdomains with this SDK.
My user flow:
- customer visits my.domain.com.
mParticle.init()is called when the page loads. - customer picks a product to buy
- customer logs in and
mParticle.login()is called, resulting in the correctuser_identitiesbeing sent alongside future mParticle events - customer is redirected to www.domain.com to complete checkout.
mParticle.init()is called when the page loads.
Expected result: the user_identities object contains our user's customerid.
Actual result: the user_identities object is empty.
The initializing code looks like this on the www.domain.com subdomain:
import mParticle from '@mparticle/web-sdk';
const mParticleConfig = {
deviceId: '...',
workspaceToken: '...',
identifyRequest: {
userIdentities: {
// The value below comes from a cookie. I verified that
// it is valid before building this config object.
customerid: "12345678",
}
},
dataPlan: {
planId: '...',
},
};
mParticle.init("api id goes here", mParticleConfig);If I reload the page at this point, the next mParticle.init() call will work as expected. Could you help me figure out whether this is a user error or a bug in the SDK? Does the SDK maintain some kind of persistence layer that carries over between subdomains and would prevent the identifyRequest field from taking effect?
Thank you in advance 🙏
Metadata
Metadata
Assignees
Labels
No labels