I’m working on a React Native app and want to track app installations using Facebook’s Conversion API. I’ve set up Facebook’s SDK in my app, but I’m having trouble integrating the Conversion API.

Here’s what I’ve done so far:

  • Integrated Facebook SDK for React Native.
  • Configured Facebook app events. Events can be seen on the Events Manager dashboard.
  • Consulted the Facebook documentation on Conversion API.

I’ve found that the Conversion API is mainly designed for server-side tracking. My questions are:

  • How can I send installation events from a React Native app to the Facebook Conversion API?
  • Are there any specific libraries or tools I should use to facilitate this integration?
  • Should I send these events directly from the app, or is it better to send them through a server? Any guidance or examples would be greatly appreciated!

I really appreciate any help you can provide.

I'm using the following Google Apps Script to pull in data using the Google Ads API. The data appears to be pulling in fine, but parsing it seems to be an issue. Here is the script:

 function getGoogleAdsData() {   const fileId = 'fileID';   const campaignSheetName = 'Campaigns';   const campaignMetrics = ['segments.date', 'campaign.id', 'metrics.cost_micros'];   // Calculate the dates for the previous week (Monday to Sunday)   const today = new Date();   const dayOfWeek = today.getDay(); // 0 (Sunday) to 6 (Saturday)      // Adjust today to get the last Sunday   const lastSunday = new Date(today);   lastSunday.setDate(today.getDate() - dayOfWeek - 0);   // Calculate the previous Monday (6 days before last Sunday)   const lastMonday = new Date(lastSunday);   lastMonday.setDate(lastSunday.getDate() - 6);   const formattedStartDate = Utilities.formatDate(lastMonday, Session.getScriptTimeZone(), 'yyyy-MM-dd');   const formattedEndDate = Utilities.formatDate(lastSunday, Session.getScriptTimeZone(), 'yyyy-MM-dd');      Logger.log(`Fetching data from ${formattedStartDate} to ${formattedEndDate}`);   // Fetch Campaign Data   const campaignData = fetchGoogleAdsData(formattedStartDate, formattedEndDate, campaignMetrics);   const formattedCampaignData = campaignData.map(row => [     formatDate(row[0]), // Date     row[1], // Campaign ID     row[2] // Cost in currency units   ]);      // Write to Sheets if there's data   if (formattedCampaignData.length > 0) {     writeToSheet(fileId, campaignSheetName, formattedCampaignData, ['Date', 'Campaign ID', 'Cost']);   } else {     Logger.log('No data available to write to the sheet.');   } } function fetchGoogleAdsData(startDate, endDate, metrics) {   const query = `     SELECT ${metrics.join(', ')}     FROM campaign     WHERE segments.date BETWEEN '${startDate}' AND '${endDate}'   `;      const apiUrl = 'https://googleads.googleapis.com/v17/customers/xxxxxxxx/googleAds:searchStream';   const options = {     method: 'POST',     headers: {       'Authorization': `Bearer ${ScriptApp.getOAuthToken()}`,        'developer-token': 'OUR-TOKEN',       'login-customer-id': 'xxxxxxxxxx'     },     contentType: 'application/json',     payload: JSON.stringify({ query: query }),     muteHttpExceptions: true   };      const response = UrlFetchApp.fetch(apiUrl, options);   const responseData = JSON.parse(response.getContentText());   Logger.log(`Full API Response: ${JSON.stringify(responseData)}`);   if (responseData.length > 0 && responseData[0].results) {     Logger.log(`Found ${responseData[0].results.length} result(s).`);     return responseData[0].results.map(result => {       Logger.log(`Metrics object: ${JSON.stringify(result.metrics)}`);       const row = [];       metrics.forEach(metric => {         let value = getNestedValue(result, metric.split('.'));         Logger.log(`Metric: ${metric}, Value: ${value}`); // Log each metric's value         if (metric === 'metrics.cost_micros') {           value = value / 10; // Convert micros to currency units           Logger.log(`Converted cost_micros: ${value}`);         }         row.push(value);       });       return row;     });   } else {     Logger.log('No results found in response or response structure is different.');     return [];   } } function getNestedValue(obj, keys) {   return keys.reduce((acc, key) => (acc && acc[key] !== undefined) ? acc[key] : null, obj); } function writeToSheet(fileId, sheetName, data, headers) {   const sheet = SpreadsheetApp.openById(fileId).getSheetByName(sheetName);   sheet.clear(); // Clear existing data   sheet.appendRow(headers); // Add headers   if (data.length > 0 && data[0].length > 0) {     sheet.getRange(2, 1, data.length, data[0].length).setValues(data); // Add data   } else {     Logger.log('No data to write to the sheet.');   } } function formatDate(dateString) {   const date = new Date(dateString);   return Utilities.formatDate(date, Session.getScriptTimeZone(), 'dd/MM/yyyy'); } 

The full API response looks something like this:

Full API Response: [{"results":[{"campaign":{"resourceName":"customers/xxxxx/campaigns/3509213","id":"3509213"},"metrics":{"costMicros":"41060000"},"segments":{"date":"2024-08-26"}},{"campaign":{"resourceName":"customers/xxxxx/campaigns/3509213","id":"3509213"},"metrics":{"costMicros":"54460000"},"segments":{"date":"2024-08-27"}},{"campaign":{"resourceName":"customers/xxxxx/campaigns/3509213","id":"3509213"},"metrics":{"costMicros":"33690000"},"segments":{"date":"2024-08-28"}}..... 

And further logging shows this:

8:05:38AM  Info    Found 232 result(s). 8:05:38AM  Info    Metrics object: {"costMicros":"41060000"} 8:05:38AM  Info    Metric: segments.date, Value: 2024-08-26 8:05:38AM  Info    Metric: campaign.id, Value: 3509213 8:05:38AM  Info    Metric: metrics.cost_micros, Value: null 8:05:38AM  Info    Converted cost_micros: 0 

I've tried changing the metrics.cost_micros to metrics.costMicros, but this doesn't work and returns an unrecognised field.

Why is 'Metric: metrics.cost_micros, Value: null'?

Wondering can anyone point me in the right direction here. I am trying to access the activity endpoint of the facebook marketing api and keep getting a missing permissions error.

https://developers.facebook.com/docs/marketing-api/reference/ad-activity/

Can anyone help or point me to what I am doing wrong?

I am following this stack so think I am right in graph endpoint:

Using the Activity Log Endpoint in the Facebook Marketing APIs

Endpoint I am creating looks like this in python:

url = f"https://graph.facebook.com/v20.0/act_{account_id}/activities?access_token={access_token}" 

I have tried recreating my token and giving all permissions to it and still getting the same error so not sure what I am missing. Can someone point me to the permissions required for it? This is the error I'm seeing:

Here is the error:

{'error': {'message': '(#100) Missing permissions', 'type': 'OAuthException', 'code': 100, 'fbtrace_id': 'Aa6zg3SUnxRo_rLBI6EQTtA'}} 

I have my own instagram account and i have created an app in meta for my account automation.

Everytime i automate private replying to a DM, i get below error after sometime.

{   "error": {     "message": "The thread owner has archived or deleted this conversation, or the thread does not exist.",     "type": "IGApiException",     "code": 100,     "error_subcode": 2534001,     "fbtrace_id": "AgLmAH4eepLIf1PqLBN3y4J"   } } 

When i reply with a comment, i get this below error.

{   "error": {     "message": "This API call does not support the requested response format",     "type": "OAuthException",     "code": 20,     "error_subcode": 1772111,     "is_transient": false,     "error_user_title": "Create Comment Failed - Spam Detected",     "error_user_msg": "To protect the Instagram community, your comment was flagged as spam and could not be added. Please review your comment's content and try again.",     "fbtrace_id": "Aj9iw77tVvnd-loKZG7ULPy"   } } 

There is no documentation for these error code on https://developers.facebook.com/docs/messenger-platform/error-codes/

  1. My meta app is verified.
  2. I am using long lived access token in api calls.

Everything seems fine, why is instagram blocking my automation? How is same working with manychat?

Intially i found some reference to verify my app to prevent this error. So, i have verified my meta app with meta.

Any idea how I can dynamically instantiate AssetOperation in GoogleAds python client?

I'm getting:

TypeError: 'AssetOperation' object is not callable 

In code:

        for video_name, video_id in video_name_id_list:             # Dynamically create an instance of AssetOperation >           asset_operation = self.asset_operation_type(                 create={                     'name': video_name,                     'youtube_video_asset': {'youtube_video_id': video_id}                 }             ) E           TypeError: 'AssetOperation' object is not callable 

Here are my tries:

or:

When I use this: