1
votes

I'm trying to add users to a custom audience via API.

My schema looks like this:

"schema": [
  EMAIL,
  PHONE,
  LN,
  FN,
  ZIP
]

My data looks like this:

"data": [
  [
    hashWithKey("[email protected]", "EMAIL"),
    "12345678910", // -> No hashing, since there's no HASH key specified in docs.
    hashWithKey("John", "LN"),
    hashWithKey("Smith", "FN")
    hashWithKey("1919", "ZIP")
  ],
  ...
]

Although I'm getting an OK response from the API, I'm not sure how to check if the audience was created as I wanted.

  1. Is it OK not to hash the phone number? If not, what key should I be using? I tried with PHONE and I still got an OK from the API. So I'm confused.
  2. When using CSV files to create the audience, I can specify the field age. According to Facebook docs, seems not to be possible to specify age via API. Is it enough by sending DOBY? Does anyone figured this out?

These are the best links I could find:

1
See "Multi-key Matching" in the link you provided: developers.facebook.com/docs/marketing-api/audiences-api $schema = array( CustomAudienceMultikeySchemaFields::FIRST_NAME, CustomAudienceMultikeySchemaFields::LAST_NAME, CustomAudienceMultikeySchemaFields::EMAIL,); $customAudienceMultiKey->addUsers($users, $schema); - Ryan

1 Answers

0
votes

So this is what I did to make it work:

  • I didn't hash the data
  • I set is_raw: true
  • I cleaned up my data: Some of the emails were comming with quotes, like "[email protected]"

Being that done, everything worked as expected.