Support » Plugin: Google Analytics for WordPress by MonsterInsights » [Plugin: Google Analytics for WordPress] Price bug with e-Commerce and Shopp – here's the fix

  • In both the following ecommerce tracking functions, the price is not formatted correctly for Google. This is apparent if you have a product/order over £1000.

    The fix is to use number_format() to ensure that decimals places are correct and there is NO comma for thousands.

    wpec_transaction_tracking()

    The references to nzshpcrt_currency_display() should instead use number_format().

    number_format( $purchlogs->allpurchaselogs[0]->totalprice, 2, '.', '' )
    number_format( $total_tax, 2, '.', '' )
    number_format( $total_shipping, 2, '.', '' )

    shopp_transaction_tracking()

    The references to number_format() should ensure there is no thousands seperator.

    number_format( $Purchase->total, 2, '.', '' )
    number_format( $Purchase->tax, 2, '.', '' )
    number_format( $Purchase->shipping, 2, '.', '' )

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  • The topic ‘[Plugin: Google Analytics for WordPress] Price bug with e-Commerce and Shopp – here's the fix’ is closed to new replies.