e commerce - Tracking the products using Enhanced Ecommerce with Google Analytics -
i have implemented google analytics multiple trackers using url : https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#working_with_multiple_trackers have tried implement enhanced ecommerce in it,but product categories not being tracked.in analytics panel , showing (not set). don't know went wrong since not seo expert.
in header :
<script> //google analytics (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-123', 'auto'); ga('create', 'ua-456', 'auto', 'abc'); ga('create', 'ua-789', 'auto', 'xyz'); //ecommerce tracking code ga("require", "ec", "ec.js"); //ecommerce tracking code </script>
in product listing,where products of same category can viewed
<script type="text/javascript"> ga('ec:addimpression', { 'id': '<?php echo $sku_idx; ?>', // product details provided in impressionfieldobject. 'name': '<?php echo $curr_product['disp_name'];?>', 'category': '<?php echo check_product_brand($curr_product['category'],$curr_product['l2']).'/'.ucfirst($curr_product['category']);?>', 'brand': '<?php echo $curr_product['style'];?>', 'variant': '<?php echo $attr_code?>', 'list': 'product listing', //'position': 1 // 'position' indicates product position in list. });
at end
<script type="text/javascript"> ga('send', 'pageview'); ga('abc.send', 'pageview'); ga('xyz.send', 'pageview');
here console :
initializing google analytics. loading resource plugin: ec loading script: "https://www.google-analytics.com/plugins/ua/ec.js" running command: ga("create", "ua-123", "auto") creating new tracker: t0 auto cookiedomain found: "mytest.com" running command: ga("create", "ua-456", "auto", "abc") creating new tracker: dieselitaly auto cookiedomain found: "mytest.com" running command: ga("create", "ua-789", "auto", "xyz") creating new tracker: syg auto cookiedomain found: "mytest.com" running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. registered new plugin: ga(provide, "render", function) running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. executing google analytics commands. running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. executing google analytics commands. running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. executing google analytics commands. running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. executing google analytics commands. running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. executing google analytics commands. running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. executing google analytics commands. running command: ga("require", "ec", "ec.js") waiting on require of "ec" fulfilled. executing google analytics commands. registered new plugin: ga(provide, "ec", function) running command: ga("require", "ec", "ec.js") plugin "ec" intialized on tracker "t0". running command: ga("ec:addimpression", {id: "98263", name: "ab - jacket", category: "apparel/men/jackets", brand: "123456", variant: "900", list: "product listing"}) running command: ga("ec:addimpression", {id: "98263", name: "ab - jacket", category: "apparel/men/jackets", brand: "123456", variant: "900", list: "product listing"}) executing google analytics commands. running command: ga("send", "pageview") sent beacon: v=1&_v=j44d&a=1234658035&t=pageview&_s=1&dl=https%3a%2f%2fmytest.com%2fproduct%2fmens%2fjackets&ul=en-us&de=utf-/...... stuff here _j1 (&jid) adsenseid (&a) 1234658035 apiversion (&v) 1 clientid (&cid) 819866210.1464779007 ec:impression list "1" name (&il1nm) product listing ec:impression list "1" product "1" brand (&il1pi1br) 123456 ec:impression list "1" product "1" category (&il1pi1ca) apparel/men/jackets ec:impression list "1" product "1" id (&il1pi1id) 98263 ec:impression list "1" product "1" name (&il1pi1nm) ab - jacket ec:impression list "1" product "1" variant (&il1pi1va) 900 encoding (&de) utf-8 flashversion (&fl) 22.0 r0 hittype (&t) pageview javaenabled (&je) 0 language (&ul) en-us location (&dl) https://mytest.com/product/mens/jackets screencolors (&sd) 24-bit screenresolution (&sr) 1366x768 title (&dt) online store: jeans, clothing, shoes, bags , watches trackingid (&tid) ua-123 viewportsize (&vp) 1349x291 executing google analytics commands. running command: ga("abc.send", "pageview") sent beacon: v=1&_v=j44d&a=1234658035&t=pageview&_s=1&dl=https%3a%2f%2f stuff here _j1 (&jid) adsenseid (&a) 1234658035 apiversion (&v) 1 clientid (&cid) 819866210.1464779007 . . . executing google analytics commands. running command: ga("xyz.send", "pageview") sent beacon: v=1&_v=j44d&a=1234658035&t=pageview&_s=1&dl=https%3a%2f%2fau again stuff _j1 (&jid) adsenseid (&a) 1234658035 apiversion (&v) 1 clientid (&cid) 819866210.1464779007
sorry pasting such large console. console can see impression data being sent 1 tracking account.is other 2 tracking accounts getting data ?
you have parameter 'product category', wrong use name 'category'
Comments
Post a Comment