facebook/facebook-nodejs-business-sdk

Server Side Api Parameter Error: Unexpected key "advertiser_tracking_enabled"

Closed this issue · 8 comments

Which SDK version are you using?

17.0.2

What's the issue?

I am getting the following error Server Side Api Parameter Error: Unexpected key "advertiser_tracking_enabled" on param "$['data'][0]"." method: "POST" when sending an event with action source = 'app' and advertiser tracking enabled set.

Steps/Sample code to reproduce the issue

  if (actionSource === 'app') {
    // whether the user has opted into/out of advertiser tracking on apps.
    // @see https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/authorizationstatus/
    // 3: the user authorizes access to app-related data for tracking the user or the device
    // The parameter 'advertiser_tracking_enabled' is required for the event with the action source 'app'
    serverEvent.setAdvertiserTrackingEnabled(advertiserTrackingEnabled);
  }

Observed Results:

  • What happened? This could be a description, log output, etc.

I am getting the following error Server Side Api Parameter Error: Unexpected key "advertiser_tracking_enabled" on param "$['data'][0]"." method: "POST"

Expected Results:

  • What did you expect to happen?

The event should be sent without errors.

Investigation

For one instance, the following event is sent:

{
        "access_token": "EAiXJC4bAK",
        "test_event_code": null,
        "upload_tag": null,
        "upload_source": null,
        "partner_agent": null,
        "data": [
          {
            "advertiser_tracking_enabled": false,
            "event_id": "l8oOfFtjOxRuWBJOBLs2sKlINZ93.1691538913886",
            "event_name": "Subscribe",
            "action_source": "app",
            "data_processing_options": [],
            "custom_data": {
              "contents": [
                {
                  "id": "plan_FSFCkVrTS1sD3k",
                  "quantity": 1
                }
              ],
              "content_type": "product",
              "value": 59.99,
              "currency": "usd"
            },
            "user_data": {
              "subscription_id": "sub_1N",
              "ge": [
                "252f10c836"
              ],
              "external_id": [
                "l8oOfF"
              ],
              "country": [
                "79adb2a2"
              ],
              "fn": [
                "75117463"
              ],
              "em": [
                "7ab6eca8af8"
              ]
            },
            "event_time": 1691538913
          }
        ],
        "namespace_id": null,
        "upload_id": null,
        "id": "777428622613751"
      },

I believe (1) the advertiser_tracking_enabled flag should be set under app_data and (2) the value should be 0 or 1 according to the following documentation:

This is a follow up to the issue #251 - both issues preventing setting advertiser_tracking_enabled

Hi @jcurlier could you help file a bug here?

with the release 17.0.3, the error is now a FacebookRequestError

Error
    at FacebookRequestError.FacebookError [as constructor] (/home/app/node_modules/facebook-nodejs-business-sdk/dist/cjs.js:352:16)
    at new FacebookRequestError (/home/app/node_modules/facebook-nodejs-business-sdk/dist/cjs.js:374:129)
    at /home/app/node_modules/facebook-nodejs-business-sdk/dist/cjs.js:673:15
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

serverEvent:

_action_source: "app"
_advertiser_tracking_enabled: false
_custom_data: {
_content_type: "product"
_contents: [1]
_currency: "USD"
_value: 119.99
}

Having the same issue here

Any update on this ? advertiser_tracking_enabled

IS this wrong implementation by me? . Node js I still receive error that the value is not provided


 const serverEvent_0 = new ServerEvent()
      .setEventName(FBEventName)
      .setEventSourceUrl(eventSourceUrl)
      .setEventTime(eventTime)
      .setUserData(userData)
      .setActionSource(actionSource);
    if (actionSource === 'app') {
      serverEvent_0.setAdvertiserTrackingEnabled(1); // or 1 0r 0
    }

@saxo751 which version are you using?
#254
this issue shall be resolved already.