To be in sync with the text on page 247:
Now, replace the comment you left in the handle_params/3 function in Pro-
ductLive.Show , with this:
The call to Accounts.get_user_by_session_token/1
should be omitted on page 244:
if connected?(socket) do
user = Accounts.get_user_by_session_token(user_token)
# do tracking here!
end
Also, the implicit refactoring of maybe_track_user/1
on page 247 was a bit distracting at first, though I think it makes sense here to drop the assigns matching and the nil
case, as we only have logged in users visiting the product pages.