lat9 / ga4-analytics

A plugin to provide GA4 analytics for Zen Cart stores
GNU General Public License v2.0
1 stars 2 forks source link

Push back loading #25

Closed lunatic312 closed 6 months ago

lunatic312 commented 10 months ago

Loading needs to be moved after 140 otherwise this interferes with non-standard add to cart actions.

lat9 commented 10 months ago

An example, please, so that I've got a means to validate.

lunatic312 commented 10 months ago

Sorry, of course. I have a custom product type that uses an extra cart action.

If I add to cart, it runs the add to cart function but the item is not saved in the cart session. Moving GA4 to breakpoint 141 seems to resolve this as the extra cart actions are loaded at 140

lat9 commented 10 months ago

Right, but if that load-point is moved then any 'base' cart-related actions will be missed since the cart-related actions, if present, are performed during the main_cart_actions.php script and subsequently redirected.

What processing is performed by your custom product type's extra-cart-action that the GA4 Analytics script is 'interfering with"?

lunatic312 commented 10 months ago

It runs a function from "extra cart actions" on a class that is an extension of shopping cart add_cart

It seems that the shopping cart class runs, item is added, but subsequently removed after GA4 is triggered

lat9 commented 10 months ago

Send me a PM on the Zen Cart forums (https://www.zen-cart.com/member.php?81053-lat9) with your direct email address so that I can get some additional information. What you've supplied thus far is too vague to diagnose.

lat9 commented 6 months ago

Closing due to lack of response.