Measurement Protocol Reimbursement Data

I solved all the problems with sending data, but I get problems when trying to refund.

I sent this array to the 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 is wrong? Perhaps I need an additional call to the measuring system, please advice. BTW Google hit the debugger return 'valid'.

+4
source share
2 answers

I resolve this as follows:

I sent a new transaction with a negative value of val

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

Then send an event with a negative value

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

, google, , , script GET (https://www.google-analytics.com/collect?payload_data&) POST.

+1

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

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

, !

+1

Source: https://habr.com/ru/post/1605744/


All Articles