[python-analytics-admin] Questions about activating Google Signals
Hi
I'm trying to activate the google signals setting using the API, but I'm having some issues with that. I don't know if I'm doing something wrong, but when I try to use the update_google_signals_settings on a property without google signals active, I get the following error message:
google.api_core.exceptions.FailedPrecondition: 400 Google Signals must be activated on this property before its enable state may be changed.
However, when I try to update the google signals settings on a property that I already activated the google signals (directly on the property settings), I'm able to change the settings.
So, I don't know if is not possible to activate signals using the API, or if I'm doing something wrong.
Hi @rafaelft1988, Please could you share the code that you're using to help re-create this issue?
Hi @parthea , here's the code that I'm using. Just need to change the zeroes with a property id that doesn't have google signals active:
from google.analytics import admin_v1alpha
from google.analytics.admin import AnalyticsAdminServiceClient
import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'credentials.json'
client = AnalyticsAdminServiceClient()
google_signals = admin_v1alpha.GoogleSignalsSettings(
name='properties/000000000/googleSignalsSettings',
state='GOOGLE_SIGNALS_ENABLED',
consent='GOOGLE_SIGNALS_CONSENT_CONSENTED'
)
request = admin_v1alpha.UpdateGoogleSignalsSettingsRequest(
google_signals_settings=google_signals,
update_mask="*"
)
response = client.update_google_signals_settings(request=request)
print (response)
When i run this code, I get this error:
google.api_core.exceptions.FailedPrecondition: 400 Google Signals must be activated on this property before its enable state may be changed.
Thanks
Hey @parthea, I'm also facing this issue with google-analytics-admin version 0.14.0. Is this expected to be resolved soon?
Thanks in advance!
Moving to google-cloud-python repository.
b/230723724