Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

bigquery's transfer from Facebook Ads : don't run successfully

I followed all steps. T created the datasets, and the transfers in Big Query. Also I created the Apps in Meta for Developers and the transfer's start successfully but then encounter errors like: 

<eye3 title='/ReaderService.ReadStream, INVALID_ARGUMENT'/> generic::INVALID_ARGUMENT: INVALID_ARGUMENT: Exception was thrown by the Connector implementation: Error in executing ReadPartition request for asset with query SELECT Target,DatePreset,DateStart,DateEnd,TimeIncrement,Level,AccountCurrency,ActionAttributionWindows,AdAccountId,AdAccountName,CampaignId,CampaignName,AdSetId,AdSetName,AdId,AdName,BuyingType,Clicks,ConversionRateRanking,CostPerEstimatedAdRecallers,CostPerInlineLinkClick,CostPerInlinePostEngagement,CostPerUniqueClick,CostPerUniqueInlineLinkClick,CPC,CPM,CPP,CTR,EstimatedAdRecallRate,EstimatedAdRecallers,Frequency,Impressions,InlineLinkClicks,InlineLinkClicksCounter,InlinePostEngagement,InstantExperienceClicksToOpen,InstantExperienceClicksToStart,InstantExperienceOutboundClicks,Objective,QualityRanking,Reach,Spend,UniqueClicks,UniqueCTR,UniqueInlineLinkClicks,UniqueInlineLinkClickCounter,UniqueLinkClicksCounter,Checkins,EventResponses,LinkClicks,OfferSaves,OutboundClicks,PageEngagements,PageLikes,PageMentions,PagePhotoViews,PostComments,PostEngagements,PostShares,PostReactions,PageTabViews,Video3SecondViews,Region,AdEffectiveStatus,UseAsync,DefaultSummary FROM AdInsights WHERE Target = 'act_10150126956904941' AND Level = 'ad' AND DatePreset = 'yesterday' AND UseAsync = True com.google.cloud.hosted.integrationservice.common.ConnectorStatusException: <eye3 title='INVALID_ARGUMENT'/> generic::INVALID_ARGUMENT: INVALID_ARGUMENT: Exception was thrown by the Connector implementation: Error in executing ReadPartition request for asset with query SELECT Target,DatePreset,DateStart,DateEnd,TimeIncrement,Level,AccountCurrency,ActionAttributionWindows,AdAccountId,AdAccountName,CampaignId,CampaignName,AdSetId,AdSetName,AdId,AdName,BuyingType,Clicks,ConversionRateRanking,CostPerEstimatedAdRecallers,CostPerInlineLinkClick,CostPerInlinePostEngagement,CostPerUniqueClick,CostPerUniqueInlineLinkClick,CPC,CPM,CPP,CTR,EstimatedAdRecallRate,EstimatedAdRecallers,Frequency,Impressions,InlineLinkClicks,InlineLinkClicksCounter,InlinePostEngagement,InstantExperienceClicksToOpen,InstantExperienceClicksToStart,InstantExperienceOutboundClicks,Objective,QualityRanking,Reach,Spend,UniqueClicks,UniqueCTR,UniqueInlineLinkClicks,UniqueInlineLinkClickCounter,UniqueLinkClicksCounter,Checkins,EventResponses,LinkClicks,OfferSaves,OutboundClicks,PageEngagements,PageLikes,PageMentions,PagePhotoViews,PostComments,PostEngagements,PostShares,PostReactions,PageTabViews,Video3SecondViews,Region,AdEffectiveStatus,UseAsync,DefaultSummary FROM AdInsights WHERE Target = 'act_10150126956904941' AND Level = 'ad' AND DatePreset = 'yesterday' AND UseAsync = True

Does anyone help me?

1 2 666
2 REPLIES 2

Hi @alePB The error you're encountering indicates that there is an issue with the query you're executing to transfer your Facebook Ads data to BigQuery. Specifically, the error INVALID_ARGUMENT suggests that the query or some aspect of its execution is invalid. I see your query es very large though and contains a lot of fields. I will suggest you to ensure that all fields you are querying (Target, DatePreset, etc.) are valid fields in the AdInsights table. Also, Review the syntax of your SQL query to ensure it conforms to the expected format for the Facebook Ads API and the BigQuery connector. As this involves some technical knowledge I will lastly suggest you to validate each field in your SELECT statement to ensure it is correct and supported. You can simplify the query and gradually add fields to identify which one might be causing the issue while you check Facebook Marketing API documentation at the same time. If you can not get your query to work, as this involves some coding knowledge, you can consider exporting your Fb Ads data to BigQuery using an external tool that basically pulls the data from the API just like you are doing but will save you a lot of time and headaches. In my case, I use windsor.ai to export my social media data (not only Fb ads one). I hope you get to find a solution for this. Good luck!

If the automated transfer continues to fail, you can use Facebook's Graph API directly to fetch the Ads data. Create a script that fetches the data via the API and manually uploads the results to BigQuery using CSV or JSON exports. Use tools like Google Cloud Functions or App Scripts to automate this process in a way that mimics the transfer.

If you're looking for a simpler and more reliable way to transfer Facebook Ads data to BigQuery, consider using Skyvia (https://skyvia.com/data-integration/integrate-facebook-ads-google-bigquery). This tool can directly connect Facebook Ads with BigQuery without the need for coding or managing API keys manually.