Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Removes taxes from order total when sending order information to Google Analytics - for use with Google Analytics Pro
<?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