How to handle data (Google analytics Events) on router.post endpoints #1971
Unanswered
rudolfbruder
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am facing a struggle when using inertia js and accessing data that happen on router.post events.
An example. I have a shopping cart made in inertia.js. There is a plus button next to product which increases quantity in cart.
When I click the plus button this logic happens:
My problem is that I call this route via inertia router.post like this:
I am not able to access the $datalayerEvent because there is redirect to cart index going on after addition to cart.
Is there some 'inertia' way of getting data from my post request, doing some logic with it and then navigating to cart index page?
I dont want to use axios calls and handle state of my cart because that seems counterintuitive to inertia.js logic. I mean that would be like coding classic laravel api vue app itself.
Beta Was this translation helpful? Give feedback.
All reactions