javascript - Google Analytics - wider date range shows less visits than a shorter date range. Possible dimensions and metrics mismatch? -
this question kind of two-parter. appreciate if answers both parts.
part 1 - wider date range shows less visits narrower range
i having trouble query of mine. these dimensions , metrics , filters using:
metrics: ga:visits,ga:visitbouncerate,ga:goalcompletionsall,ga:goalconversionrateall dimensions: ga:landingpagepath,ga:medium filters: ga:landingpagepath==/online-access/benefits-online-account-video.html;ga:visits>1;ga:medium==organic,ga:hassocialsourcereferral==yes,ga:medium==cpc,ga:medium==cpc
if start-date
2015-01-01 , end-date
2015-05-30, query returns 0 fields, if change start date 2015-02-01 , end date 2015-02-28, 17 visits, , other metric fields have values more correct. after investigating little bit, thought maybe had dimensions-metric mismatch, @ point have no idea.
part 2 - matching dimensions , metrics
i little confused how can combine metrics , dimensions. example, the dimensions , query explorer seems suggest ga:sessions can combined ga:sessiondurationbucket or deprecated ga:visitlength. sample code ga api reference shows ga:sessions combined ga:source , ga:keyword - neither of listed compatible dimensions in explorer.
conclusion
can make sense of me? i'm pretty new google analytics in general, let alone accessing through api, may not have yet picked fundamentals needed understand happening here.
edit: reports in actual google analytics interface used 100 percent of sessions, believe means not using sampled data. also, graphs show sessions in millions wider date range. , if narrow date range february, shows 1,189,675 sessions~~, 17 sessions ridiculously wrong anyway.~~ realized not filtered specific page i'm filtering in query.
(i know i'm using deprecated ga: values, should work same, no?)
part 1 -- running sampling issue. although edit says getting unsampled data, not clear if looking @ same report (and date range) query. reports unsampled, when add custom filters, tend increase probability ga sample. try rebuild report in ga user interface first, , determine if it's sampled or not. (click on customization tab in image.)
part 2 -- i'm not sure getting 'compatible' dimensions , metrics here. real conflict in google analytics whether you're filtering users or sessions. if you're using sessions, can extract dimension (think x-axis on chart) gives information session: came (i.e. source , medium), when occurred (i.e. date), session duration bucket falls into. dimension grouping parameter metric (think y-axis).
so in sample code linked:
get apiquery = analytics.data().ga() .get(tableid, // table id. "2012-01-01", // start date. "2012-01-15", // end date. "ga:sessions") // metrics. .setdimensions("ga:source,ga:keyword") .setsort("-ga:sessions,ga:source") .setfilters("ga:medium==organic") .setmaxresults(25);
this going pull number of sessions (your metric) occurred 2012-01-01 2012-01-15, grouped source , keyword (your dimensions), organic medium only, sorted sessions , source readability. it's same information shows in google analytics -> acquisition reporting menu, it's kosher query api same way.
Comments
Post a Comment