Cross-domain connection problem

  • 2 November 2021
  • 7 replies


Hi all!

We want to create a cross-domain connection to our three sites and create funnel of conversion.

Landing - registration form - web site. 

We have installed the JavaScript SDK on all three sites, but there was a problem. When user goes from landing to the registration form, everything is fine. Amplitude connects all events and stores them in one user. When user go from the registration form to website, amplitude changing amplitude id and user id on new numbers and create story with events which created on website.

Device id in three cause the same one.


Best answer by belinda.chiu 15 November 2021, 20:33

View original

7 replies

Userlevel 5
Badge +4

@Maxim Thanks for reaching out to the Amplitude Community! :wave:  I’m more than happy to help here! 

So the behavior you are seeing is expected if your organization is not maintaining cross-domain tracking. I highly recommend taking a read through this documentation on how to set-up cross-domain tracking:

Hope this helps! 


@belinda.chiu thank you! 

We set up our cross-domain connection according this instruction. And it’s work with first and second site, but doesn’t work with the third :( 

Maybe is it influence by the fact that we have three sites, not two?


Attached amplitude information



@belinda.chiu maybe you have some ideas about our situation?

Userlevel 5
Badge +4

@Maxim That’s great to see that you have this set-up accordingly! I do see that the device_id is maintained the same across the domains. 

However, it looks like on your 3rd site, your organization is setting a different user ID on that device_id. This is no longer a cross-domain tracking issue for anonymous users but rather an issue of how your sites are assigning different user IDs. 

How does the 3rd site know what user ID to assign? It may be best to check in on that site to figure out how your organization is setting user IDs on that site. I would recommend to make sure that the user ID it is assigning is the same user ID as the user ID assigned on the first two sites given that user should be the same. 


@belinda.chiu i’m check details and you’re right. On 3rd site (after registration) we assign user id according to the number assigned in our database, which leads to the loss of history. 

If we turn off this assignment on 3rd site and leave the previously user id which created by Amplitude, will user history continue monitoring, if the user breaks the session or refreshes the page?

Userlevel 5
Badge +4

@Maxim Thanks for sharing context on that!

Just to quickly clarify, Amplitude never assigns User IDs to users. User ID is an identifier completely controlled by the customer (you) and is not something that Amplitude can touch unless it was coded in such a way. I recommend reviewing this article about how unique users are tracked:

I wanted to make sure this is clear as you mentioned “leave the previously user id which created by Amplitude”. All the User IDs you see on your users are from your organization. If your organization shouldn’t be assigning different User IDs to the same user, you might want to look into your instrumentation as there seems to be an error on your end. 

If you turn off assignment, the next anonymous event on that device_id will fall under the last known user with that device_id - see this scenario: So long as the device_id remains the same, then the anonymous events should get tied to the most recent known user with that device_id. 

Hope this helps!