Posts under category google-ads-api

Does Boto3 client support connectors for GoogleAds and FacebookAds? According to documentation we can use Custom Connector but when i try to use it in the code i get the below error saying it should be one of the built in types.

[ERROR] ParamValidationError: Parameter validation failed: Unknown parameter in connectorProfileConfig.connectorProfileProperties: "CustomConnector", must be one of: Amplitude, Datadog, Dynatrace, GoogleAnalytics, Honeycode, InforNexus, Marketo, Redshift, Salesforce, ServiceNow, Singular, Slack, Snowflake, Trendmicro, Veeva, Zendesk, SAPOData Unknown parameter in connectorProfileConfig.connectorProfileCredentials: "CustomConnector", must be one of: Amplitude, Datadog, Dynatrace, GoogleAnalytics, Honeycode, InforNexus, Marketo, Redshift, Salesforce, ServiceNow, Singular, Slack, Snowflake, Trendmicro, Veeva, Zendesk, SAPOData Traceback (most recent call last):   File "/var/task/lambda_function.py", line 34, in lambda_handler     response = client.create_connector_profile(   File "/var/runtime/botocore/client.py", line 391, in _api_call     return self._make_api_call(operation_name, kwargs)   File "/var/runtime/botocore/client.py", line 691, in _make_api_call     request_dict = self._convert_to_request_dict(   File "/var/runtime/botocore/client.py", line 739, in _convert_to_request_dict     request_dict = self._serializer.serialize_to_request(   File "/var/runtime/botocore/validate.py", line 360, in serialize_to_request     raise ParamValidationError(report=report.generate_report()) 

Code in Lambda :

import json import boto3 def lambda_handler(event, context):     client = boto3.client('appflow')        ### Google Ads     response = client.create_connector_profile(     connectorProfileName='GoogleAdsConn',     connectorType='CustomConnector',     # connectorLabel='GoogleAds',     connectionMode='Public',     connectorProfileConfig= {       "connectorProfileProperties": {           'CustomConnector': {                 # 'profileProperties': {                 #     'string': 'string'                 # },                 'oAuth2Properties': {                     'tokenUrl': 'https://oauth2.googleapis.com/token',                     'oAuth2GrantType': 'AUTHORIZATION_CODE'                     # ,'tokenUrlCustomProperties': {                     #     'string': 'string'                     # }                 }             }             },       "connectorProfileCredentials": {         "CustomConnector": {              "authenticationType": "OAUTH2",             "oauth2": {                 "accessToken": "myaccesstoken",                "clientId": "myclientid",                "clientSecret": "myclientsecret",               "oAuthRequest": {                   "authCode": "string",                  "redirectUri": "string"               },                "refreshToken": "myrefreshtoken"             }       }     }        }    )     return {         'response': response     } 

Any leads on this will be appreciated.
Thanks!

I have a website hosted in AWS with a NodeJS backend.

I have Google Ads conversion events being sent from the frontend using gtag.js, but I noticed missing events and a lot of duplication (even if I use transaction IDs with my events)

I had similar issues with Facebook Pixel and was able to resolve the problem by sending simple vanilla http calls from my backend server.

Is it possible to do the same with Google Ads? I have not been able to find any documentation for server side APIs for Javascript. This documentation here seems promising, but no Javascript SDK exists. That's is why I would like to know what vanilla http calls to make.

I have seen documentation about GTM server side, but it seems I need to host a GTM container (server?) which I would prefer not to have to. Unless I misunderstood what hosting a GTM container means in the context of a AWS cloud solution.

So in short, my task is to extract data from Google, and I'm curious if it's possible to fetch data using Google Ads API for different customers without all the required keys (developer token, refresh token, client_id and client secret). Is this possible or not? If yes, what privileges do I need, and what are the steps? If you know where I can find some clear documentation about this, it will be a lifesaver.

Thanks!

I may be doing it the wrong way but I want, at first, to extract keyword traffic information like I did with TrafficEstimationService in the (now deprecated) AdWords API. My code looks like this (with some edits here and there):

# [... some initialization (clients, service accounts, etc.) bits here] # fetch an instance of the Google Ads client gc = GoogleAdsClient.load_from_storage(gads_credentials_file, version="v10") # fetch an instance of the Google Ads service gs = gc.get_service("GoogleAdsService") # fetch an instance of the Geo Target Constant service gtcs = gc.get_service("GeoTargetConstantService").geo_target_constant_path # fetch an instance of the keyword plan idea service ks = gc.get_service("KeywordPlanIdeaService") # build the initial search request rq = gc.get_type("GenerateKeywordIdeasRequest") rq.customer_id = gads_account_id.replace("-", '') rq.geo_target_constants = [gtcs(get_location_id(gads_country))] rq.keyword_plan_network = (gc.enums.KeywordPlanNetworkEnum.GOOGLE_SEARCH_AND_PARTNERS) rq.language = gs.language_constant_path(get_language_id(gads_language)) rq.keyword_annotation = gc.enums.KeywordPlanKeywordAnnotationEnum if len(gads_keywords) > 0:     rq.keyword_seed.keywords.extend(gads_keywords) # generate keyword ideas keyword_ideas = ks.generate_keyword_ideas(request=rq) rows = [] for idea in keyword_ideas:     rows.append({         "date": r,         "text": idea.text,         "competition_value": idea.keyword_idea_metrics.competition.name,         "avg_monthly_searches": idea.keyword_idea_metrics.avg_monthly_searches     }) 

So far, so good. I can specify location and language and (of course) they keywords to look for. At the end of this request, I have something like this (just printing the first list item):

{'date': '2022-08-09', 'text': 'zapatos', 'competition_value': 'MEDIUM', 'avg_monthly_searches': 301000} 

The problem I have is I have been requested to ensure the match type is EXACT but looking at both the documentation and the source code for KeywordPlanIdeaService there is no trace of this parameter. That's why I assume I'm doing it wrong (or maybe I'm lacking something here). In any case, I'm a bit lost.

Can you tell me how can I specify this (if it can be done) or an alternate way to accomplish this?