Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about "facebook-ruby-ads-sdk custom audience" registration #37

Closed
sankak opened this issue Dec 8, 2017 · 6 comments
Closed
Labels

Comments

@sankak
Copy link

sankak commented Dec 8, 2017

Hi, I am trying to make a registration of a custom audience using "facebook-ruby-ads-sdk" (gem is below).
I am using the source below.
https://github.com/facebook/facebook-ruby-ads-sdk/blob/v0.2.11.0/lib/facebook_ads/ad_objects/helpers/custom_audience_helpers.rb

When I specify the schema "UID" and use the method "add_user",
"is_raw" parameter is set to "true" in the library, and request to the Marketing API got sent.

The UID is hashed based on Digest::SHA256.hexdigest(data) in the gem.
When data is hashed, which "is_raw" parameter is correct, "true" or "false" ?

I appreciate for your support.

@yandod
Copy link

yandod commented Dec 11, 2017

@sankak could you provide minimal code sample reproduce that issue?

@sankak
Copy link
Author

sankak commented Dec 15, 2017

here is sample source code.

@ad_acc = FacebookAds::AdAccount.get("act_XXXXXXXXXX",  {
    access_token: "YYYYYYYYYYY",
    app_secret: "ZZZZZZZZZZZZZZ"
})

@ca = @ad_acc.customaudiences.create({
  name: "name",
  subtype: "CUSTOM",
  description: "description",
})

# ids is examples for app scoped user id.
ids=[99999999990, 999999999991, 999999999992] 

# 00000000000000 is example for FB application id.
# ids is hashed in add_user method in the gem
@ca.add_user(ids, 'UID', {app_ids: [00000000000000]})

then, send marketing api with is_raw paramater true.

@yandod
Copy link

yandod commented Jan 11, 2018

お待たせして申し訳ありません。
状況を確認いたしました。
すでに対策されているかもですが、上記のユースケースだけで言えば pre_hashedにtrueを指定すれば is_rawがtrueでデータもrawのリクエストを作れそうです。

ids=['99999999990', '999999999991', '999999999992']
p @ca.prepare_params(ids, 'UID', {app_ids: ['936846693102846'], pre_hashed: true})
{:payload=>{:schema=>"UID", :data=>["99999999990", "999999999991", "999999999992"], :is_raw=>true, :app_ids=>["936846693102846"]}}

そもそもハッシュ化した形で送信する仕様にすべきどうかで、gem自体の修正方針が変わってきますのでこちらは引き続き確認いたします。

@sankak
Copy link
Author

sankak commented Jan 16, 2018

ご連絡ありがとうございます。
pre_hashedにtrueを指定した所、正常にカスタムオーディエンスが登録できました。

@stale
Copy link

stale bot commented Jan 14, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Jan 14, 2020
@stale
Copy link

stale bot commented Jan 21, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants