Hi all,
I am trying to track users using Presence, but I might miss some important pieces.
I would like to track every user on the website.
If I track a user in iex, I am able to see it in the tracking page:
iex(26)> MyAppWeb.Presence.track(self(), "myapp:presence", user.id, %{email: user.email})
So I decided to put the same line in every controller, to track users that navigates the various pages, but what I got as the presence message diff is something like:
%{
joins: %{
"c6d10ab9-13bd-4809-aed7-89549ee66e47" => %{
metas: [%{email: "user@email.com", phx_ref: "F0PzlVF7lm0KmiCL"}]
}
},
leaves: %{}
}
%{
joins: %{},
leaves: %{
"c6d10ab9-13bd-4809-aed7-89549ee66e47" => %{
metas: [%{email: "user@email.com", phx_ref: "F0PzlVF7lm0KmiCL"}]
}
}
}
So like the user joined and then left right after.
What am I missing here?
Sorry for being so novice, I am trying to learn by doing…
Kind Regards