Get google analytics id from the code embed?
As an example, the code I have to embed has an ID of the form: UA-3235632-1
, but to use 开发者_高级运维the data export API I need the ID from the URL of the proper page, in this case: 6270018
.
How do I get the real ID from the UA type ID?
That feature of the the GA Data Export API could indeed be a little more clear.
Here's what you need to do:
login to the GA Browser and in the upper-right-hand corner drop-down menu, select your GA Account of interest (assuming you have more than one--if you don't then you are already on right page). The page that renders will be the Website Profiles for that Account. Find the row in that table that corresponds to the Profile (Report) you want retrieve data from and click on the next-to-last column Edit;
The page you'll see now will say Profile Settings in the upper left-hand corner. Just under that, in smaller font, you'll see Profile ID followed by a string of digits (probably six to eight). This is what you want (in the python client for the GA Data Export API, it is referred to as TABLE_ID)).
To retrieve this parameter (TABLE_ID) programmatically, the GA Data Export API Account Feed returns this value to you in the dxp:tableID field. In particular, an Account Query will return the list of profiles under that Account to which you have access; each Profile will have a tableID in the field i mentioned just above.
精彩评论