Removes taxes from order total when sending order information to Google Analytics - for use with Google Analytics Pro
This file contains 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 // only use if needed | |
// Will remove taxes from the order total when transmitting to Google Analytics | |
function sv_wc_gapro_send_revenue_only_order ( $params ) { | |
$order_total = $params['tr']; | |
$order_tax = $params['tt']; | |
$revenue = $order_total - $order_tax; | |
$params['tr'] = $revenue; | |
return $params; | |
} | |
add_filter( 'wc_google_analytics_pro_api_ec_purchase_parameters', 'sv_wc_gapro_send_revenue_only_order' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment