You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect it to be consistent. I believe the 2.x API always sent a string value, though we used up:layer:location:changed on 2.x. When we upgraded we found that up:layer:location:changed wasn't called when navigating the history via back/forward, so we referred to the Unpoly 3.x docs and found the analytics page recommending using up:location:changed.
As a temporary workaround we are able to reliably extract the value by doing:
Bug description
I am following the recommendation for tracking pageviews by listening to
up:location:changed
event: https://unpoly.com/analyticsWhen the event is triggered from following a link,
event.location
is a string (e.g./news
).However when the event is triggered from clicking on back/forward buttons,
event.location
is a an entireLocation
object.Reproduction project
See: https://satisfying-intermediate-ankle.glitch.me/
With the following test in
scripts.js
:Steps to reproduce the behavior:
Location
objectExpected behavior
I would expect it to be consistent. I believe the 2.x API always sent a string value, though we used
up:layer:location:changed
on 2.x. When we upgraded we found thatup:layer:location:changed
wasn't called when navigating the history via back/forward, so we referred to the Unpoly 3.x docs and found the analytics page recommending usingup:location:changed
.As a temporary workaround we are able to reliably extract the value by doing:
Browser version
The text was updated successfully, but these errors were encountered: