Right way to use Google Analytics API - google-analytics-api

Has anyone worked with GA API? I want to make a custom report on my web application by pulling data from my Google Analaytics Account. This may include pulling goals and conversions data. Is this possible?

Yes its possible but its a little tricky.
You can test what I am talking about here: http://ga-dev-tools.appspot.com/explorer/
Restricted dimension and metric combinations:
If you check the Dimension and metric reference. next to each of the dimensions and metrics there you can check them on and off. If you check under the Goals conversions group you will notice that when you select some of them you are no longer able to select other ones. So you will have to decided exactly what data you need and are allowed to request from the API.
XX in the metrics
If you check some of the goal metrics you will notice that they have an XX in them. The xx must be replaced with the goal number that you wish to select out. For example: ga:goalXXStarts would become ga:goal1Starts
List of all goals
If you need to get a list of all of the goals you will find that in the Management API not the core reporting API.
I hope this helps.

Related

How do I get statistics on Azure Devops usage?

I am currently administering a project on DevOps and wish to verify how many users are using the platform actively.
I want the following information -
1. Unique visitors per month
2. All visits per month
3. All visits by roles
The best you're going to be able to get is from the usage page (https://dev.azure.com/your_organization/_settings/usage) or audit REST API. It doesn't include everything you want, but you can probably play with the data once you have it to aggregate it into a format that's more to your liking and extract some of the information you're after.
Based on my opinion, all of those what you want could be achieved by audit log.
Beside the api that Daniel mentioned, we offered a direct download button to download those data. Just select the time period and download them with CSV/JSON format:
Here, I suggest you download with CSV because it is convenient to apply data filter in it.
Unique visitors per month
This could be get from the last row: ActorDisplayName.
All visits by roles
This can be achieved by combined with Users list files. In users page, we also offered a button to download user lists as .csv file.
Just combine the data of auditlog.csv and users.csv, then you will get the statistics on visiting by roles.
All visits per month
Not sure what the exactly visit you mentioned. But I think you could get most of you want from auditlog.csv, because we stored the access ip, user agent, and detailed operations.
You may think above is not friendly for viewing. So I recommend analyze those statics with Power BI. It can help create histograms, pie charts or line charts and etc, which are very awesome to analyze the data.

Google Analytics Metadata API: Allowed Dimensions/Metrics Combinations

The Metadata API doesn't have an attribute or specific mapping to allowed dimensions/metrics combinations?
I am not sure if this is a question or a statement but you are correct the Google Analytics metadata API returns a list of dimensions and metrics that can be used in the Google Analytics Core reporting API.
At this time there is no API that will tell you which dimensions and metrics are valid combinations. the only way to do that is to check the dimensions and metrics reference manually or run the request and see what happens.
I have discussed it with the API team over the last several years its on there list but I don't think it has a very high priority for them.

AEM Campaign analytics

We building personalization feature and use AEM targeting engine to deliver personalization content. However, I see that in admin section of the AEM Segmentation, there is any attribute called "Impresssions" which I believe is stats on how many times the customized content was shown to user.
Assuming that, how does AEM get to know the statistics? Is it something AEM takes care of automatically or I have code or configure something explicit. The reason why I ask is, I see the snippet like below in kernal.js file.
if (window.CQ_trackTeasersStats && n.trackingURL) {
h(M, n.trackingURL)
}
I noticed that n.trackingURL is null in my case.
Any help shall be appreciated. And also should I looking for impression statistics in author env or publish env?
AEM Campaign use a OOTB or custom Impressions service to calculate the Impressions.
There are two option in AEM to calculate the impressions
Yes, This something AEM can take care automatically
for you but it will not give you a correct picture as every instance will be having a separate copy so you have to write some code to collect all values and push it back to all environment.
You also have an option of using your Adobe Sitecatalyst to
calculate an impression which gives you a more accurate count of
impressions. for this sitecatalyst expose their rest service so that
you can update the impressions on run time.
n.trackingURL is null because you have not configured the sitecatalyst account for this environment.
Read docs Or
Implementations instruction:

how to specify URL in filters pagePath core reporting api V3

I am building a web app that pulls data through the Core Reporting Api v3 from Google. I am using the client PHP library offered by Google.
I am currently trying to specify a page and retrieve its pageviews for a time range. Every other seems to be working okay except for the fact that if a specfy a filter with ga:pagePath==http://link/uri then I get 0 all the time no matter the time range.
I think the problem is got to do with the setting of value for this pagePath. I want to have spearate data for the desktop version of the site and the smartphone version denoted by s. subdomain
Can anyone hint me on some tips and or tricks to use to get the required data?
Example URL:
http://domain.com/user/profile/id/1
http://s.domain.com/user/profile/id/1
Thanks in advance!
for the the default implementation of Google Analytics, ga:pagePath doesn't include the scheme or hostname so in your case you'd actually want to filter using ga:hostname and ga:pagePath together.
I suggest you use the Query Explorer to build your queries and get familiar with what will work. You can also use this tool to at least get a sense for what type of data the ga:pagePath and ga:hostname dimensions return before trying to filter on them. Finally, once you have the query you want, you can easily get the exact Core Reporting API query by clicking on the Query URI button.
Also check out the Combining Filters section of GA API docs.
So if you want filter on ga:pagepath for domain.com and s.domain.com separately you could do something like
filters=ga:pagePath==/user/profile/id/1;ga:hostname==domain.com
filters=ga:pagePath==/user/profile/id/1;ga:hostname==s.domain.com

Clarification on Bing Maps API locationCode field

I'm working on learning the Bing Maps API for my current project at work. In various locations in route and traffic data output, there is a field called locationCode (or locationCodes). The documentation provides no clarification on what this field is, except to state: "A subscription is typically required to be able to interpret these codes for a geographical area or country."
Nothing I've been able to find yet defines this further or clarifies what data that code can be translated into by these subscription services. So, what are some of the services available to translate this code and what data can be obtained via these services?
Those information are related to traffic for specific roads, see the details for the API:
http://msdn.microsoft.com/en-us/library/hh441726.aspx
Also the description of each field included in the result:
http://msdn.microsoft.com/en-us/library/hh441730.aspx
You are referring to the locationCode. Those are related to the Traffic Message Channel information where the included information are the event id, the location code, expected incident duration, affected extent and other details.
Those TMC are managed in different ways depending on the country you are interested in and specialised mapping data provider can give you access to those kind of information and that's what the subscription is about. It is also related to the way you can use the TMC depending on the concerned area to get or give information from there.
For more information about TMC:
http://en.wikipedia.org/wiki/Traffic_message_channel