facebook-nodejs-business-sdk icon indicating copy to clipboard operation
facebook-nodejs-business-sdk copied to clipboard

Facebook not receive all events

Open tapinambur0508 opened this issue 3 years ago • 1 comments

Which SDK version are you using?

facebook-nodejs-business-sdk 10.0.1

What's the issue?

Events are sent successfully on the base of the eventRequest.execute() response, but the number of events in facebook is less

Steps/Sample code to reproduce the issue

const { UserData } = require('facebook-nodejs-business-sdk');
const { ServerEvent } = require('facebook-nodejs-business-sdk');
const { EventRequest } = require('facebook-nodejs-business-sdk');
const { FacebookAdsApi } = require('facebook-nodejs-business-sdk');

const ACCESS_TOKEN = "";
const PIXEL_ID = "";

module.exports.handler = (data, callback) => {
      FacebookAdsApi.init(ACCESS_TOKEN);

      const user_data = new UserData()
        .setClientIpAddress(data.ip)
        .setClientUserAgent(data.ua)
        .setFbp(data.fbp)
        .setFbc(data.fbc)
        .setExternalId(data.externalId);

      const server_event = new ServerEvent()
        .setEventName(data.eventName)
        .setEventTime(Math.floor(data.eventTime / 1000))
        .setUserData(user_data)
        .setEventSourceUrl(data.sourceURL)
        .setActionSource('website');

      const eventsData = [server_event];
      const eventRequest = new EventRequest(ACCESS_TOKEN, PIXEL_ID).setEvents(eventsData);

      eventRequest
        .execute()
        .then((result) => console.log({ result }))
        .catch((error) => console.log({ error }))
        .finally(() => callback());
}

Response

result: EventResponse {
	_events_received: 1,
	_messages: [],
	_fbtrace_id: 'AkdB0fb02FKetbKeA4FyZ6j',
	_id: undefined,
	_num_processed_entries: undefined
}

Expected Results:

Expect then number of send events using SDK and in Facebook is equal

tapinambur0508 avatar Jun 03 '21 09:06 tapinambur0508

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 09 '22 02:01 stale[bot]