thebergamo / react-native-fbsdk-next

MIT License
633 stars 165 forks source link

I don't see real time events in Facebook Business "Test the events" tab #490

Closed Ace090 closed 8 hours ago

Ace090 commented 2 months ago

I'm following the example in the documentation to track an event.

But when I run the app in debug mode I don't see the event in the "Test the events" tab of Event management in Facebook Business to test the events in real time. However, I see it correctly after some time in the overview tab.

Do I need to do something to enable real time tracking?

I've looked around but can't find anything about it Thank you

priyankagupta23pg commented 2 months ago

same here ..I am not able to see real time data in Test Event section

hgeorgilas commented 2 months ago

I had the same issue but forgot to enable the SDK in my app's entry point App.js/tsx

Make sure you have initialized the SDK

import {Settings} from "react-native-fbsdk-next";

// Facebook SDK init
Settings.initializeSDK();

No error was thrown on the console though I had to check the logcat to find what the issue was

If you are on android you can use the following command to filter logs only related to your package id

adb logcat | grep -F "`adb shell ps | grep com.yourpackage.com | tr -s [:space:] ' ' | cut -d' ' -f2`"
Bi0max commented 2 months ago

hi, also having the same trouble. And Facebook also tells to "update the latest Facebook SDK".

I am using EXPO. I have set up everything and initialized the SDK, set all flags to true and also got the Tracking Permission on iOS.

  const initializeFacebook = () => {
    Settings.initializeSDK();
    Settings.setAdvertiserIDCollectionEnabled(true);
    Settings.setAutoLogAppEventsEnabled(true);
  };
const requestIOSTrackingPermission = useCallback(async () => {
    const { status } = await requestTrackingPermissionsAsync();
    setTrackingPermissionStatus(status);
    if (status === "granted") {
      await Settings.setAdvertiserTrackingEnabled(true);
    }
    setIsAdvertiserTrackingEnabled(await Settings.getAdvertiserTrackingEnabled());
  }, []);

Trying to log some events, but do not see them in "Test Events" tab in Facebook Business.

const sendTestAdEvents = useCallback(async () => {
    AppEventsLogger.logEvent(AppEventsLogger.AppEvents.StartTrial);
    // Log a $15 purchase.
    AppEventsLogger.logPurchase(15, "USD", { param: "value" });

    // Log standard event. e.g. completed registration
    AppEventsLogger.logEvent(AppEventsLogger.AppEvents.CompletedRegistration, {
      [AppEventsLogger.AppEventParams.RegistrationMethod]: "email",
    });

    AEMReporterIOS.logAEMEvent("fb_mobile_purchase", 20, "USD", { param: "value" });
  }, []);

I know the repo is not really very active, but maybe someone has found a way. In the meanwhile I'll try to use Branch.io for capturing event and will let you know here, if it worked.

Bi0max commented 2 months ago

Though it seems I am getting some events: only "Activate App" and "App Installs" image Not the events I am trying to log. Facebook also still does not see that SDK version is up to date.

lightstrike commented 1 month ago

@Bi0max Hitting the same issues with a managed Expo project. Were you ever able to resolve the "Update your apps to the latest Facebook SDK" issue?

Did you end up exploring Branch.io using the react-native-branch package?

Bi0max commented 1 month ago

@lightstrike , hi. Yes, at the moment I am using react-native-branch. The issue with "Update your apps to the latest Facebook SDK" was resolved either because Branch SDK sends events to Facebook now, or because Facebook is slow and sees the Facebook SDK in the app only after a few days.

But anyway, I have removed the Facebook SDK from the app completely and the Branch SDK correctly sends events for Android devices. For iOS devices I have set up the SKAdNetwork through Branch.IO as well and I just received my first install event today. So it seems to work as well.

RationalChestnut commented 1 month ago

Also getting this issue. Would rather not use branch.io. Any solutions?

TowhidKashem commented 1 month ago

One more with the same issue in a expo managed workflow using a dev client. I get the sdk out of date error and am not seeing events appear in Meta Events Dashboard. Also if I do:

await Settings.getAdvertiserTrackingEnabled();

it outputs true but doing:

AppEventsLogger.getAdvertiserID();

outputs nothing. Is this package working or are we all doing something wrong here??

RationalChestnut commented 1 month ago

Mine is now working. Followed this tutorial: https://www.youtube.com/watch?v=VADy1X8NHeo&t=783s

stale[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.