How to access report data in a "App + Web" google analytics property using The Google Analytics Reporting API v4? - google-analytics-api

I have a Web+App google analytics property, and I need to access report data using The Google Analytics Reporting API v4. In the docs, the field viewId is required to build a ReportRequest object. But, in the new google analytics Web+App feature, you cannot create a view from the property.

For GA4 Properties, you need to use the Google Analytics Data API v1. See the devsite: https://developers.google.com/analytics/trusted-testing/analytics-data
App + Web Properties were recently renamed to GA4 Properties. See the blog post: https://blog.google/products/marketingplatform/analytics/new_google_analytics/.
The Google Analytics Reporting API v4 (https://developers.google.com/analytics/devguides/reporting/core/v4) accepts numeric view identifiers in report requests. GA4 Properties do not have views, and there is not a way to create views in those properties.

Unfortunately Reporting API v4 doesn't support App+Web properties for the exact reason you stated - the API only understands view ID's and not property ID's.
Looking at the documentation, it's noted there that it doesn't support your setup, however, they do have a tester program that allows you to test and provide feedback when it comes to new reporting features for properties like the one you use.
https://developers.google.com/analytics/devguides/reporting/core/v4

Related

Is it possible to make an API call to link a GA4 and UA property in a Google Analytics account?

I am migrating to GA4 from Universal Analytics and am planning to create a script to make API calls to create the new GA4 properties as we have many properties.
However, in order to prevent Google from creating a duplicate property come March.
I would either need to connect the new GA4 property to its UA counterparts
or
Turn off the flag "Automatically set up a basic Google Analytics 4 property"
Is there a way to do either of these through an api? Or is the only option to do this manually through the Google Analytics UI?
I experimented with the apis available for property management and account management through the current api reference(v1beta) and was unable to find an api solution
https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties

Equivalent dimensions for ga:adContent and ga:keyword in the Google Analytics Data API (GA4)

We currently rely on using UTM parameters (utm_source, utm_medium, utm_campaign, utm_term, utm_content) for our Universal Analytics integration with the Google Analytics Core Reporting API and Multi-Channel Funnels APIs.
Are there plans to support UTM tags in GA4 properties and the Google Analytics Data API? I do see sessionSource, sessionMedium, and firstUserCampaignName listed in the dimensions list, which suggests utm_source, utm_medium, and utm_campaign can still be used. Is there an equivalent dimension for utm_content (ga:adContent in the Core Reporting API and mcf:adwordsAdContent in the MCF API) or utm_term (ga:keyword or mcf:keyword)?
There seem to be no equivalent dimensions for ga:keyword or ga:adContent in the Google Analytics Data API. I will try to find out more about this and update this question once I have more information.
Ilya
The Google Analytics Team

reporting api v4 unique events metric issue

I just want to ask you about the Reporting API v4 because I'm seeing different values between API response and web reporting view (Google Analytics dashboard). The metric is unique events.
This is the query using API Explorer
API Explorer query screenshot
And here is the API Explorer result (if you want to see the query, read my first comment below, please notice green and red highlighted)
API Explorer result screenshot
On the other hand I'm using the web report viewer and for unique events I'm always seeing different values (also I used many other filters, with different scenarios, always returning different data in unique events metric), but (the weird thing) is total events value is ok (in all cases). I used the same dates for API and web view calls (also I applied same filters on web reporting, also I tested using other metrics and the values are the same, so there is no layer 8 issue)
Web reporting screenshot
Do you know what's going on here? I don't know which value is correct, I don't know if API or web reporting is failing.
Best.-
Please check this changelog entry - https://developers.google.com/analytics/devguides/changelog#event_tracking and this support article - https://support.google.com/analytics/answer/7084499?hl=en
It's all connected to the changes in unique events-connected metrics from September '16 (you can read more about it on Analytics Blog under "Improving Google Analytics Events with Unique Events" post).
Right now:
WEB UI "Unique Events" = API "ga:uniqueEventsTemporary";
WEB UI "Unique Dimension Combinations" = API
"ga:uniqueDimensionCombinations" and "ga:uniqueEvents".
This is the query using API Explorer (I posted in an answer because I couldn't do in question, only 2 links allowed)
API Explorer query screenshot

Google Analytics Retrieve Starred Profiles via API

Is it possible to retrieve a list of ga_account_id and ga_profile_id from only the 'starred' profiles by my analytics account programatically?
I've read through the API docs and can't see how this is possible.
You can do this with the Management API . I strongly recommend the account summary's report as its just one request and will return everything you need.
GET /management/accountSummaries

Google AdWords - How to correctly use Auto-Tagging and UTM variables in AdWords?

Let me preface this question with a little background information:
I have a web based system that takes in data from the Google Analytics API and displays that information based upon each clients needs via a web interface.
I use unique URLs for each source/campaign ( Google AdWords, LinkedIn, Facebook, Display Ad Networks, etc. ) containing 'utm' variables and the system generated values. Example: url.com/?utm_source=Google&utm_medium=PPC&utm_content=1234&utm_campaign=This-is-the-campaign-name
Google Analytics is the repository, since a large majority of clients use it on their websites, it's a natural fit to use them as the workhorse for data capturing.
All of the clients have active Google AdWords campaigns, connected Google Analytics accounts, and they have enabled Auto-Tagging.
When I test a Google text ad, the link that is populated in the web browser is similar to the following: url.com/?utm_source=Google&utm_medium=PPC&utm_content=1234&utm_campaign=This-is-the-campaign-name&gclid=123xyz
My current dilemma is centered around AdWords campaigns with Auto-Tagging enabled. The data capture process for all sources ( excluding Google AdWords ) works fine. I have unique tracking codes populated in the 'utm_content' variable, therefore when I call the Google Analytics API, this tracking code acts as my unique identifier. For all Google AdWords campaigns, I update all the destination links within the ad creative to include the system generated URLs that also include the prepopulated values. When viewing the reporting in Google Analytics, the variables/values are non-existent, it is as if Google completely disregards these values and uses a back-channel from Google AdWords to Google Analytics to input the campaign properties. For these Google AdWords campaigns, the visits are not lost, but rather they are associated to the standard Google AdWords campaign/ad group in Google Analytics.
Here is a list of things that I do know:
From what I have read, disabling Auto-Tagging would fix this issue and allow the 'utm' variables and their values to be passed from Google AdWords into Google Analytics. The consequence of disabling Auto-Tagging would be the loss of click to conversion and cost data.
KISSmetrics has documented a similar issue when working with clients that also use Google Analytics. Links that contain the 'gclid', Example: url.com/?gclid=123xyz ( Auto-Tagging enabled ), will not have any additional information logged ( campaign source, medium, etc. ). Links that also contain the 'utm' variables, Example: url.com/?utm_source=Google&utm_medium=PPC&utm_content=1234&utm_campaign=This-is-the-campaign-name&gclid=123xyz, this information is passed to KISSmetrics. For this second scenario, I am assuming the KISSmetrics javascript is reading the URL variables and values.
Here is what I am trying to achieve:
I am trying to avoid having to add a proprietary javascript that reads the URL variables and values and then posts that information to an external URL.
I do not want to add line items to the current Google Analytics javascript ( example: custom variables ).
I am looking for an 'out-of-the-box' solution that perhaps takes into consideration AdWords ValueTrack parameters. My familiarity with these variables is limited, therefore I can not determine if one of these values can be used as a unique identifier to later reference when I access the data using the Google Analytics API. Or as an alternative, using a Google AdWords dimension to do the same. See http://developers.google.com/analytics/devguides/reporting/core/dimsmets/adwords.
I would like to determine if it is possible to continue with the methodology of generating unique URLs, assigning them to Google AdWords campaigns, and taking the results of those campaigns from Google Analytics via their API, without compromising the click to conversion and cost data ( disabling Auto-Tagging ).
Thanks in advance for reading through my plight and any feedback you provide will be greatly appreciated.
So you are correct. When Google Analytics sees both UTM params and the auto-tagging GCLID, it discards the UTM params in favor of the GCLID.
However... acknowledging that this is an issue, especially since AdWords advertisers that use their Conversion Import feature often use both UTM and GCLID, they enabled an override switch in Google Analytics accounts that allows the use of both.
You can learn more about it in their FAQ at https://support.google.com/analytics/answer/1033981?hl=en
I think this should solve your problem.
Jon