Posts tagged with amazon-appflow

I am using the Facebook Ads connector in AWS AppFlow to transfer Facebook Ads data. While I can successfully transfer all data objects, the data for ads is being accumulated over the entire lifetime of the ads rather than on a daily basis.

For instance, when generating reports using Facebook's Graph API, I retrieve daily data as follows:

https://graph.facebook.com/{ad_id}/insights?fields={field_names}&time_range={'since':'2021-08-19','until':'2021-08-20'} https://graph.facebook.com/{ad_id}/insights?fields={field_names}&time_range={'since':'2021-08-20','until':'2021-08-21'} https://graph.facebook.com/{ad_id}/insights?fields={field_names}&time_range={'since':'2021-08-21','until':'2021-08-22'} 

I would like to achieve the same daily data transfer using AWS AppFlow for the entire duration the ad has been running. How can I configure AWS AppFlow to transfer the ads data on a daily basis instead of the accumulated data over the ad's lifetime? Any guidance or examples would be greatly appreciated.

I have got the following data transferred for the lifetime of ad run between 2021-08-17 and 2024-06-05

{"account_currency":"USD","account_id":"","account_name":"","actions":[{"action_type":"onsite_conversion.post_save","value":"7"},{"action_type":"comment","value":"10"},{"action_type":"link_click","value":"433"},{"action_type":"post","value":"39"},{"action_type":"like","value":"3969"},{"action_type":"post_reaction","value":"2847"},{"action_type":"page_engagement","value":"7305"},{"action_type":"post_engagement","value":"3336"}],"ad_id":"","ad_name":"","adset_id":"","adset_name":"","buying_type":"AUCTION","campaign_id":"","campaign_name":"","clicks":"8000", "date_start":"2021-08-17","date_stop":"2024-06-05" 

What I need is a daily level data transfer for all the days between 2021-08-17 and 2024-06-05 i.e, for all the days the ad has run.

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'm trying to use AWS AppFlow to ingest Google Ads supported objects to AWS S3. Though i have successfully created connections using GoogleAds Connector I'm unable to ingest the data to S3.

Steps followed from AWS console:
Step 1: Name of the flow was provided.
Step 2: Configure Source and Destination. Recently created Google Ads Connection was chosen for source and AWS S3 bucket for destination. Flow Trigger is set to ‘Run on Demand’ (Step2 Figure )
Step 3: Map Data Fields: This page throws the error. (Step3 Figure)

I have followed all the steps as it is from AWS Doc
Error Message:

An error occurred while retrieving fields Error while communicating to connector: The request failed because the service Source Customconnector returned the following error: Details: GoogleAds metadata response can not be null or empty, ErrorCode: ServerError.


I also tried changing the mapping method and chose to upload a mapping csv file but even it failed with the error "Couldn't parse rows from the file."


Alternatively when trying to retrieve the campaign object from the python script it returns the desired output.

Any leads around this will be appreciated.
(Also this is my first post on stack overflow :P)