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

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

Related

How would I go about creating a product in the Stripe extension in Firebase using flutter?

I am building an event management app and am currently in the stage of adding payment funcionality to it. I have followed the firebase documentation and all seems to be in working order and I can easily add products to my firestore database when using the Stripe dashboard. I am just wondering how this could be done either client side (flutter) or using cloud functions?
I have tried watching tutorials, looking at the limited github examples and reading the documentation however all the products seem to be made through the stripe dashboard - obviously not ideal to have to manually create every one!
Creating Products via the Stripe API requires an Account's secret API key. You should never expose this since it provides full access to your account. So creating Products from the client-side is not something we will consider.
Additionally the Stripe Firebase Extension does not include any cloud functions for creating Products. The docs even have you create a restricted key to keep your account safe. All of that suggests to me that you will want to either
Create products from the Stripe Dashboard as previously indicated in tutorials and documentation.
Run local scripts to create products via the API using one of Stripe's client libraries which you can install locally.

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

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

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

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