Missing google analytics hook
-
Hello,
i do have a problem with your plugin (which is awesome), the custom thank you page can’t be tracked by google analytics. This is what the tag manager says:
A WooCommerce extension alters your default order received page
WooCommerce by default does not include any Google Analytics tracking. You need to use a plugin to achieve this. Most plugins rely on some hooks and functions on the order received page that WooCommerce executes by default. There are some WooCommerce plugins however that alter this order received page allowing you to select a custom-made page instead of the default page. This is shiny and useful in most cases but some plugins do? not execute the same hooks and codes on those custom order received pages, preventing other plugins to see that the user just placed an order.
Obviously, you should either avoid using such plugins or contact the plugin author to update the plugin so that it mimics all elements and behavior of the default order received page.If you are using a custom thankyou page, you will need to ensure that some background code tells my plugin and other plugins that this is your order received page. You can do this my hooking into the woocommerce_is_order_received_page filter and return true on your custom page:
https://docs.woocommerce.co…you should create a new function in your PHP files and use the add_filter() WordPress function to hook into the woocommerce_is_order_received_page filter. You need to check whether the user is on your own thankyou page. This could be done using the is_page() WordPress function using the post ID of your thankyou page.
You will also need to ensure that the order key is present in the URL of the custom thankyou page like on the default page.
Rules of thumb: you need to exactly mimic the background behavior of the default order received page.
The hook woocommerce_is_order_received_page should be true. The thank you page should have the same php structure as the original thank you page.
Any help is really appreciated. Kind regards Julian
The page I need help with: [log in to see the link]
- The topic ‘Missing google analytics hook’ is closed to new replies.