user4547691
user4547691

Reputation:

Measurement Protocol refund data

I've resolved all issues with sending data, but receive issue when trying to refund.

I've sent this array to measurement protocol :

        'v' => '1',
        'tid' => $tid,
        'cid' => $cid,
        'ti' => '12345', // this transaction exist in google
        't' => 'event',
        'ec'=> 'Ecommerce',
        'ea'=> 'Refund',
        'ni'=> '1',
        'pa'=> 'refund'

But without any result. So my question is what's wrong? Maybe I need some additional call to measurement system, please advice. BTW Google hit debugger return 'valid'.

Upvotes: 4

Views: 2553

Answers (2)

stevensagaar
stevensagaar

Reputation: 58

For full refund you need to send the following

'v'='1',
't'='pageview',
'tid'='UA-3333333-8', 
'cid'='382537459.1455511043',
'pa'='refund',
'ti'='000000038',
'dp'='admin/order/refund'

for partial refund you need to send

'v'='1',
't'='pageview',
'tid'='UA-3333333-8', 
'cid'='382537459.1455511043',
'pa'='refund',
'ti'='000000038',
'dp'='admin/order/refund',
'pr1id' => '24-WB04',
'pr1qt' => 1

Hope it helps!

Upvotes: 1

user4547691
user4547691

Reputation:

I've resolve it in this way :

I've sent new transaction with negative val

            'v' => '1',
            'tid' => $tid,
            'cid' => $cid,
            'ti' => $order,
            't' => 'transaction',
            'tr' => '-'.$order_total

Then send event with negative value

            'v' => '1',
            'tid' => $tid,
            'cid' => $cid,
            'ti' => $order,
            't' => 'item',
            'in' => $product['name'],
            'ip' => '-'.$order_total,
            'ic' => $products['sku'],
            'iq' => -1

And it works, transactions disappear from google reports, btw also want to note that I switch script to use GET ( https://www.google-analytics.com/collect?payload_data& ) instead of POST.

Upvotes: 0

Related Questions