include browser/os/screen_size in e-commerce analytics events
All checks were successful
deploy / deploy (push) Successful in 1m37s
All checks were successful
deploy / deploy (push) Successful in 1m37s
Event call sites (product_view, add_to_cart, checkout_start, purchase) were only passing visitor_hash and pathname, leaving browser, OS, screen size and country nil. Add AnalyticsHook.attrs/1 helper to extract common analytics fields from socket assigns, and use it in all LiveView event call sites. Checkout controller reads the same fields from the session. Also fix plug analytics test to clear stale events before assertions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ defmodule BerrypodWeb.Plugs.AnalyticsTest do
|
||||
setup do
|
||||
send(Buffer, :flush)
|
||||
:timer.sleep(50)
|
||||
Repo.delete_all(Event)
|
||||
:ok
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user