Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set "Advertising Features" and other settings through Google Analytics Management API?

I'm trying to use the Google Analytics Management API to automate the management of a large amount of GA Properties, which is what it's for according to the docs.

However, I'm having trouble with a lot of settings, that it seems like are not available through the API. The expected format of a GA property resource is quite limited in the fields you can set, and it seems to not allow specifying other fields.

Specifically, I am interested in setting the "Advertising features", aka whether to enable the Demographics and Interest Reports:

Advertising features setting in Google Analytics

When updating this setting through the GA UI, the field within the request seems to be called demographicsEnabled, but I cannot set or retrieve this value when using the Management API.

How can I set this and other values through the Management API, or other means? If only a small fraction of the settings for a property can be set through the API, that seems kinda useless for managing large accounts, as the docs claim you can do - so I assume there has to be a way I'm just not seeing here.

like image 830
Laura Avatar asked Jan 15 '20 11:01

Laura


People also ask

How do I enable Google Analytics advertising features?

Click Admin, and navigate to the property for which you want to enable these features. In the Property column, click Tracking Info, then click Data Collection. Under Data Collection for Advertising Features: To enable Remarketing, set Remarketing and Advertising Reporting Features to ON.

What are advertising features in Google Analytics?

Analytics Advertising Features is a collection of features that takes advantage of the Google advertising cookies so you can do things like: Create Remarketing Audiences based on specific behavior, demographic, and interest data, and share those lists with Google Ads.

How do I advertise with Google Analytics?

Click on the "Property Settings" tab: Scroll down to the "Advertising Feature" section and enable the "Enable Demographics and Interest Reports" option, and save : To learn more about the Demographics and Interest reports, click here. You can also enable the "Enhanced link attribution".


2 Answers

How can I set this and other values through the Management API, or other means?

You cant the management api is very limited in what fields you are able to update. Unfortunately unlike a number of other google apis documentation it doesn't actually tell you which fields are writeable. I will mention that to the team.

If only a small fraction of the settings for a property can be set through the API, that seems kinda useless for managing large accounts, as the docs claim you can do - so I assume there has to be a way I'm just not seeing here.

The API was not intended for managing large accounts IMO. It was probably only intended for getting information about what accounts a current user has access to.

What i suggest that you do is create a feature request asking for the ability to update the fields that you are trying to update. The team is normally very open to those types of requests.

Link it here and i will be happy to bring it to the teams attention next time i speak with them.

like image 99
DaImTo Avatar answered Mar 18 '23 11:03

DaImTo


AFAIK this and many other features are not available in Management API.

like image 31
Дмитро Булах Avatar answered Mar 18 '23 11:03

Дмитро Булах