Can you import data like page view counts to googl

2020-03-30 06:39发布

问题:

I came across a horrible problem: the google tracking code of one of our webpages apparently has not been included for 2 days which where really important to have statistics of inside GA.

The question is, can you import data like page counts of former days to google analytics when you have server logs (or a manually created csv maybe)?

I read this article but I dont quite understand if it does what I need. I know its not a programmable question but the forums on this are horrible and questions requarding importing apache server logs are from 2009. Any help is greatly appreciated.

EDIT: I know there are several questions on this but none discuss the feature of data imports. Maybe it is possible after all.

回答1:

Alex, I am afraid you can't do that.

Dimension widening works "on-the-fly", meaning if you have for example author ID as one of the URL parameters, you can tell GA to replace that ID with author name from pre-uploaded value list. But you cannot do that historically.

What you can do is to extract the data with API and then do some log-parsing to get the numbers you need. The basic ones like pageviews, visits, visitors etc. shouldn't be much of an issue.

But unfortunately there is no way you can re-upload the data historically and have all campaign-related information available. Looking at the Data Collection section, if you go to Measurement Protocol which is behind everything Google Analytics collects, it says:

The Measurement Protocol only allows developers to collect user-interaction (event / hit) data. It does not allow developers to upload aggregated data like tables.

Also, if you review the possible parameters - there is no date/time available, so I am pretty sure you cannot technically upload historical data.