javascript - Newest Google Analytics API reference? -


i've got unusual google api code snippet:

(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-xxxxxx-1', '192.168.8.101'); ga('send', 'pageview'); 

this looks similar older variant, however, can't find reference these api. i'm looking analogues of:

  • _setcustomvar
  • _trackpageview (is 'send', 'pageview' equivalent it?)
  • _setdomainname (i want test on computer on intranet / connected http server running locally).

sorry, there confusion here. i've found reference:

https://developers.google.com/analytics/devguides/collection/analyticsjs/domains

here is, posterity, however, can't find analogue _setcustomvar , _setdomainname.

update

i've found (maybe) ga('set', { property : value }); same _setcustomvar , ga('create', 'ua-xxxxx-1', { 'cookiedomain': 'none' }) similar _setdomainname. however, still cannot report when testing locally :(

you correct, _setdomainname replaced property of create. useful because people calling _setdomainname after _trakpageview , causes problems. having property avoid confusion ordering.

ga('create', 'ua-xxxxx-1', { 'cookiedomain': 'none' }) 

also customvars called custom metrics , dimensions. more powerfull in sense configured on server side , send values on api call. can send metrics aggregated.

the new api , these changes part of bigger update on google analytics platform called universal analytics.

about universal analytics.

note in order use new tracking code webproperty must set universal analytics. can't change old web property universal analytics (at least not yet). given option use universal analytics or not when create new web property.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

java - How to create Table using Apache PDFBox -

mpi - Why is MPI_Bsend not returning error even when the buffer is insufficient to accommodate all the messages -