You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently using facebook-nodejs-business-sdk:"^18.0.0" graph api for Insights.
I have below piece of code in map which returns array of Api requests. Using the the instance of FacebookAdsApiBatch i am putting each request into it which should return multiple results as it batch
Current in lambda logs I am seeing 3 types of logs in order.
batch instance success: { kind of same json as below }
Muliple "Success addRequest" logs. One of mentioned below Success addRequest:
{ "_body": { "https://graph.facebook.com/v18.0/<CAMPAIGN_ID>/insights" } "status": 200, "_headers": [ long list of objects ], "_call": { "method": "GET", "relative_url": "https://graph.facebook.com/v18.0/<CAMPAIGN_ID>/insights? access_token=XX_X_X &**fields**=&level=campaign" "attachedFiles": "" } ....... ....... } }
RESPONSES = Null
Question is, If we pay attention on relative_url the fields value is empty despite the fact I am passing string 'impression, clicks'. I tried with array ["impression", "clicks"] and addParams({ key:Val }) but it still not passing that value. Really not sure why it is ommitting. All other parameters are fine. I doubt that this is the why I am facing issue of Null as final result. fields is important for me because I have to fetch tons of other measures as well.
Can someone please help me to figure out what is the issue? If anyone need further detail I am ready to give as much I can. Thank you in advance.
Currently in codebase we have "new Campaign" instance which has getInsights(null, query) fun which working fine. I am replacing this and trying batch call to avoid timeout error from FB for all kind of insights (campaign, adsets, ad) and therir breakdowns and mesures. By achiveing above batch call, the number of API calling to FB would be significantly reduced.
I am currently using facebook-nodejs-business-sdk:"^18.0.0" graph api for Insights.
I have below piece of code in map which returns array of Api requests. Using the the instance of FacebookAdsApiBatch i am putting each request into it which should return multiple results as it batch
Above Array of APIRequest passed in below fucntion
Current in lambda logs I am seeing 3 types of logs in order.
batch instance success: { kind of same json as below }
Muliple "Success addRequest" logs. One of mentioned below Success addRequest:
RESPONSES = Null
Question is, If we pay attention on relative_url the fields value is empty despite the fact I am passing string 'impression, clicks'. I tried with array ["impression", "clicks"] and addParams({ key:Val }) but it still not passing that value. Really not sure why it is ommitting. All other parameters are fine. I doubt that this is the why I am facing issue of Null as final result. fields is important for me because I have to fetch tons of other measures as well.
Can someone please help me to figure out what is the issue? If anyone need further detail I am ready to give as much I can. Thank you in advance.
Currently in codebase we have "new Campaign" instance which has getInsights(null, query) fun which working fine. I am replacing this and trying batch call to avoid timeout error from FB for all kind of insights (campaign, adsets, ad) and therir breakdowns and mesures. By achiveing above batch call, the number of API calling to FB would be significantly reduced.
Reference: https://www.npmjs.com/package/facebook-nodejs-business-sdk?activeTab=code
^Go under BatchExample.js
The text was updated successfully, but these errors were encountered: