thebergamo / react-native-fbsdk-next

MIT License
693 stars 167 forks source link

Mobile product ads aka Advantage+ Catalog Ads not receiving params #523

Closed beliven-davide-lorigliola closed 5 months ago

beliven-davide-lorigliola commented 7 months ago

Hi,

I'm on "react-native-fbsdk-next": "^13.0.0" and "react-native": "0.71.6".

I'm using the following hook in AppStackNavigator:

export default function () {
  useEffect(() => {
    async function manageiOSTracking() {
      const dispatch = store.dispatch;
      let status = await check(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY);
      Settings.initializeSDK();
      Settings.setAppID(FACEBOOK_APP_ID as string);
      Settings.setClientToken(FACEBOOK_APP_CLIENT_TOKEN as string);
      if (status === RESULTS.UNAVAILABLE || status === RESULTS.DENIED) {
        status = await request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY);
      }

      if (
        status === RESULTS.GRANTED ||
        status === RESULTS.LIMITED ||
        status === RESULTS.UNAVAILABLE
      ) {
        console.log('iOS tracking granted');
        Settings.setAdvertiserIDCollectionEnabled(true);
        await Settings.setAdvertiserTrackingEnabled(true);
        dispatch(setUserAdsTracking(true));
      } else {
        dispatch(setUserAdsTracking(false));
        console.log('iOS tracking NOT granted');
      }
    }

    manageiOSTracking();
  }, []);
}

Then, for example at first checkout step of my app, I track the INITIATED_CHECKOUT event like this:

 AppEventsLogger.logEvent(
        AppEventsLogger.AppEvents
    .InitiatedCheckout,
        100,
        {
        content_type: 'product',
        ids:  product.ids?.length > 1
        ? `[${product.ids.map((id: number) => `"${id}"`).join(',')}]`
        : product?.ids[0];
        currency: '€',
        num_items: 3,
      );

Now, I can see both from network tab of developer tools and Meta Developer Events Manager that events are successfully sent, but I have two major problems:

1) I'm using this library and I'm sending events with parameters in order to make work the Advantage+ Catalog Ads set by my customer, but the relative "flags" don't turn "green", as you can see in this image below:

Screenshot 2024-04-29 alle 09 54 10

2) If I try to use the "Test events" function in FB Events manager, even triggering many events from my app doesn't show anything on the realtime dashboard side...

Any hint?

beliven-davide-lorigliola commented 6 months ago

Ok, for the posterity, solution to problem 1): obviously you have to log in in the app with the same Facebook Account you're using as Meta Developer.

stale[bot] commented 5 months 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.