1

While reading Facebook Analytic's documentation, I stumbled upon this default event called EVENT_NAME_VIEWED_CONTENT that accepts 3 params: CONTENT_TYPE, CONTENT_ID and CURRENCY.

I'm wondering if Facebook provide a way match the CONTENT_ID and CONTENT_TYPE to get the resource's name maybe through a standardized endpoint that my backend should be implementing or something.

Disclaimer: I know I could just make a custom event that would also receive the name or title parameter, but I'm interested in using the defaults for now.

Christopher Francisco
  • 15,672
  • 28
  • 94
  • 206

1 Answers1

1

There's currently no way to configure Facebook Analytics to do this lookup through your own backend. However, you can use custom parameters with predefined events:

FB.AppEvents.logEvent(
  FB.AppEvents.EventNames.VIEWED_CONTENT,
  null /* valueToSum */,
  {
    [FB.AppEvents.ParameterNames.CONTENT_ID]: contentId,
    name: contentName,
  },
);

There's also nothing stopping you from passing a string to CONTENT_ID if you're really only interested in the resource's name.

FB.AppEvents.logEvent(
  FB.AppEvents.EventNames.VIEWED_CONTENT,
  null /* valueToSum */,
  {
    [FB.AppEvents.ParameterNames.CONTENT_ID]: contentName,
  },
);
Chris Barker
  • 2,279
  • 14
  • 15