Hey, Team, I am new to rudderstack. I have a situa...
# support
i
Hey, Team, I am new to rudderstack. I have a situation when once instance should be used on web page and another should be used on the specific component on the same page. i need 2 instances as they track different types of events and their custom setup. My question is: can i use 2 instances on the same page? Tried to look up more info in the documentation, but did not find satisfying clear answer...
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but we will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
Hi Vilija, can you elaborate the use case. Is the other component an iframe? We do support loading different Rudderstack instances for different subdomains, but I have not seen a request for multiple instances within a single page.
i
Hey, Thank you for getting back. In the page we have a separate component which is injected from a third party via api request. But unfortunately it is not in iframe. If we would use iframe would it support multiple instances?
m
Hi Vilija, I was talking with the team on this and they suggested that the better practice would be to use the integrations object at the event level to distinguish which destination the event should go. The limitation over here would be if you have events sent to the same destination from both these components.
Can you specify what destinations you wish to send data to from the main page and from the injected component?
i
Hello, Ranganath, sorry for not replying earlier. after we migrated to V3 we had a question if multiple instances are possible (using CDN implementation only). Before v3 we used CDN on web apps and NPM on component. We did not encounter any issues. Let me specify the setup of my case as an example: a client owns 3 different event planner web apps: wedding, birthdays, christening or something else. Each of these websites use Rudderstack where data plane, destinations are all the same except source (write key). each of these have same multistep booking component (not in iframe as mentioned before) which is maintained by the vendor and also uses rudderstack with same destinations, data plane as the web apps, but with different write key. So this means that some pages on each web app will have 2 instances (from the web app and from component). and of course each part tracks their own events. I hope this sheds some light in my current situation and provides more context of my question.
m
I actually have not seen such an implementation. The only similar implementation that I have seen is that of a customer who had multiple vendors and was able to switch the source based on the sub-domain. In your case, I can suggest the following - Use the V3 SDK in the same format (use CDN for web app and NPM for components) - Setup a call to walk the team over your particular use-case so I can share it with the team and get their input. You can setup a call here
i
We tried using NPM for component, but then our storybook fails running, that was the reason we switched to CDN. But thank you for suggestion.
Maybe you could give me some short explanation why in this case NPM would be suitable? I mean, how differently this is running under the hood?