Last active
December 3, 2021 20:39
-
-
Save dpaternina9/192d40489d332936d496bbff7c3c34c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'monsterinsights_ecommerce_do_transaction_skip_ga', 'monsterinsights_support_edd_skip_do_transaction', 10, 2 ); | |
function monsterinsights_support_edd_skip_do_transaction( $skip, $payment_id ) { | |
if ( !class_exists('Easy_Digital_Downloads') ) { | |
return; | |
} | |
$payment = new EDD_Payment( $payment_id ); | |
$payment_meta = edd_get_payment_meta( $payment_id ); | |
$cart_contents = $payment_meta['cart_details']; | |
$do_not_track = edd_get_payment_amount( $payment_id ) == 0; | |
if ( $do_not_track ) { | |
return true; | |
} | |
return $skip; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment