plain-lizard-13513
11/12/2021, 1:29 PM# segment_user_key => anonymous_id/user_id
# segment_user_id => anonid/current_user.id
#
def analytics_event_tracking
Analytics.track(
event: 'Experiment Viewed',
segment_user_key => segment_user_id,
properties: {
experiment_id: experiment.id,
variation_id: experiment.variation
}
)
end
we were using this code in the backend to fire the experiment viewed event. My comment above shows what those values can be
of course - what happens here though is we are potentially losing the context between logged in and logged out users.
If somebody comes to the site, triggers an Experiment Viewed event while logged out, registers - then their user key/id will change (now its the logged in version) and so the goal when triggered will be presumably not be measured as it can't be matched?
If we instead always use their logged out key - we lose the ability to track them across devices?
That said, while looking at the docs https://docs.growthbook.io/lib/ruby#tracking I see that you recommend not sending user identifiers at all. Is that because if we kick this to Segment they'll just handle all of this? Send the logged in/logged out ID's and the query on your side looks for both?
Be good to understand this a little more to make sure our implementation is bullet prooffuture-teacher-7046
plain-lizard-13513
11/15/2021, 5:08 PMuser_id
or anonymous_id
to put them in the experiment... but presumably we have to then make sure we fire the goal using that same ID? Or are you guys able to check the Mixpanel profile of the user and check the ID's?
I'm trying to avoid needing to put a second event "Completed experiment goal XYZ" with the specific anonymous_id/user idfuture-teacher-7046
plain-lizard-13513
11/16/2021, 1:48 PM