• Resolved Bloke

    (@bloke)


    My cart details stopped being sent to Google Analytics. It is not sending the tax and total. It will record product, quantity, item name and category but not grand total with shipping. Is the tax supposed to be $total_tax? What page can I var_dump() to see the values. All I have done is look at the source of the checkout results page. I tried to var_dump() $purchase_log and $cart but they were NULL

    https://wordpress.org/plugins/wp-e-commerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Bloke

    (@bloke)

    Changed to 2010 theme and tested. It will display tax amount and grand total on screen but tax not being sent by GA script.

    _gaq.push([‘_addTrans’,
    ’41’, // order ID – required
    ‘mysite’, // affiliation or store name
    ‘2.50’, // total – required
    ‘0.00’, // tax
    ‘10.00’, // shipping
    ‘NYC’, // city
    ”, // state or province
    ’22’ // country

    ]);
    
    _gaq.push(['_addItem','41','ABC123','Goldfish','Tropical Fish','2.50','1']);
    
    _gaq.push(['_trackTrans']);
    
    (function() {
    
    		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    
    		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    
    		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    
    		  })();

    Thread Starter Bloke

    (@bloke)

    The code is pulling tax record (tax_charged) from wpsc_cart_contents which is always zero because I am not charging per item. If I look in the wpsc_purchase_logs that is where the total tax is stored.

    Thread Starter Bloke

    (@bloke)

    Created a new function in the Google analytics class to retrieve the total tax from the purchase log instead of cart_contents table.

    Plugin Author Justin Sainton

    (@justinsainton)

    Thanks Bloke! Would you be willing to open an issue or pull request on Github so we can track this issue and implement a fix for it?

    https://github.com/wp-e-commerce/WP-e-Commerce/issues/new

    Thread Starter Bloke

    (@bloke)

    Yes I will. I just signed up. I have never used Github before. I will also send some other requests for fixes.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘sending checkout data to Google Analytics’ is closed to new replies.