Add to cart conversion snippet – Google Analytics
-
Hi,
unfortunately, after installing your plugin and verifying the condition mentioned in the FAQ, the script for the event add to cart in Google Analytics does not show me.
I am using this PHP snippet:
if ( function_exists( 'gdpr_cookie_is_accepted' ) ) { if ( gdpr_cookie_is_accepted( 'thirdparty' ) ) { add_action( "woocommerce_add_to_cart", "track_add_to_cart"); function track_add_to_cart() { add_action( "wp_head", "track_add_to_cart2"); } function track_add_to_cart2() { ?> <!-- Event snippet for Add to cart conversion page --> <script> gtag('event', 'conversion', {'send_to': 'AW-XXXXXX'}); </script> <?php } }}
Don’t know what the problem might be? I have third-party cookies enabled in the plugin settings.
I will be grateful for any answer.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Add to cart conversion snippet – Google Analytics’ is closed to new replies.