ankane/ahoy

Manually create a new visit for same client

apuntovanini opened this issue · 2 comments

Hi,

after digging a lot into the codebase, I think our use case is particular enough to ask support.

Let's say we have two customers subdomains:
foo.example.org
bar.example.org

When user visits foo.example.org a lead is saved into db, a new visit is created, visit is authenticated to the lead, everything works just as usual.
Now, when the same user visit bar.example.org, we would like to create a new visit instance, because this same user now becomes a lead to the second subdomain as well. So we create a new Lead record, and try to create and authenticate this new visit, which is never created (I think headers/cookies don't change, even if I call ahoy.reset)
We tried forcing track_visit into a custom store, resetting visit, with no success.
Do you have any clues? Do you think it's possible somehow? Did anyone else have the same requirements?
Thanks in advance!

Hi, I wrapped up some thoughts on this in a fork https://github.com/uidu-org/ahoy_multitenant
What do you think?

Hey @apuntovanini, thanks for sharing. If you're using cookies, different subdomains should create separate visits by default (I'd check the cookie domain if that's not the case).