Support » Plugin: GDPR Cookie Compliance (CCPA, DSGVO, Cookie Consent) » Add to cart conversion snippet – Google Analytics

  • Resolved MrHaza

    (@mrhaza)


    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)
  • Plugin Author Moove Agency

    (@mooveagency)

    Hi @mrhaza

    Thanks for using our plugins.

    Since this is an advanced implementation and very specific to your site, unfortunately it is outside of the scope of our support.

    We would recommend working with an experienced developer who can set this up for you.

    Sorry we can’t be of more help.

Viewing 1 replies (of 1 total)
  • The topic ‘Add to cart conversion snippet – Google Analytics’ is closed to new replies.