Analytics
6K members online now
6K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Extended Ecommerce 'purchase' event is not stored in Cordova App

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We have a Cordova/Web app that is using Extended Ecommerce API. 

 

It works as expected when we run it as a mobile website but, when we run the same code as a Cordova app the 'purchase' event is not shown in Google Analytics ECommerce reports (the rest of the pageview events are captured). 

 

I checked the HTTP Get call and it seems OK e.g. resulted from :

 

ga('ec:setAction', 'purchase', transaction );
ga('send', 'pageview');

 

https://www.google-analytics.com/collect?v=1&_v=j41&a=1896292830&t=pageview&cu=USD&_s=6&dl=file%3A%2F%2F%2Fandroid_asset%2Fwww%2Findex.html&ul=en-us&de=UTF-8&dt=Sasi%20Test&sd=32-bit&sr=412x732&vp=412x660&je=0&_u=SKAAgIIJ~&jid=273789895&cid=704b56af2997e1fd&uid=19071&tid=UA-XXXXXXXX-XX&cd1=19071&ti=65290&tr=453.99&tt=0&ts=0&pa=purchase&pr1id=123534&pr1nm=Fit%20Vanilla%20Almond%20Granola&pr1ca=Cereal%20%26%20Breakfast&pr1br=Bear%20Naked&pr1pr=4.99&pr1qt=1&pr2id=176709&pr2nm=Chocolate%20Chip%20Granola&pr2ca=Cereal%20%26%20Breakfast&pr2br=Lieber%27s&pr2pr=4.49&pr2qt=100&z=650822101

 

 

Re: Extended Ecommerce 'purchase' event is not stored in Cordova App

[ Edited ]
Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

I have some progress but I'm not sure how to overcome it.

With the help of Eike #comment59948705_36154842 I found the error:

 

 

      "description": "A value is required for parameter 'dp'. Please see http://goo.gl/a8d4RP#dp for details.",

 

 

But I don't understand why I'm getting this error since I do have &dl which should be enough according to the documentation. And is enough on other page view like this which is not called by an app:

 

 

https://www.google-analytics.com/debug/collect?v=1&_v=j41&a=906686671&t=pageview&cu=USD&_s=5&dl=https%3A%2F%2Fsasi.self-point.com%2Ffrontend%2F&ul=en-us&de=UTF-8&dt=Checkout%20%7C%20Fresh%20Market&sd=24-bit&sr=1920x1080&vp=1093x916&je=0&fl=21.0%20r0&_u=SCEAgEIJ~&jid=&cid=1397076488.1421119482&uid=19071&tid=UA-XXXXXXXXX-XX&cd1=19071&pa=purchase&pr1id=364771&pr1nm=Kariot%20Chocolada&pr1ca=Snacks%20%26%20Sweets&pr1br=Klik&pr1pr=1.59&pr1qt=100&ti=65701&tr=159&tt=0&ts=0&z=98682710 

 

Marked as Best Answer.
Solution
Accepted by topic author Guy K
March 2016

Re: Extended Ecommerce 'purchase' event is not stored in Cordova App

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

I found the issue. The issue was that when running in cordova the &dl=file://.... which fails adding path the pageview event added &dp=... which solved the issue.


Meaning I replaced

ga('ec:setAction', 'purchase', transaction);
ga('send', 'pageview');

to

ga('ec:setAction', 'purchase', transaction);
ga('send', 'pageview', $location.path());