facebook / facebook-ruby-business-sdk

Ruby SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
204 stars 161 forks source link

You are calling a deprecated version of the Ads API. Please update to the latest version: v9.0 #115

Closed HunterHillegas closed 3 years ago

HunterHillegas commented 3 years ago

Which SDK version are you using?

Gem v0.8.0.4

What's the issue?

Following the instructions here to send conversions with this SDK under the 'send requests' section: https://developers.facebook.com/docs/marketing-api/conversions-api/using-the-api

Any request sent returns with this error:

FacebookAds::ClientError ((#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v9.0.: (fbtrace_id: xxxxx))

Steps/Sample code to reproduce the issue

access_token = 'xxxx'
pixel_id = 'xxxx'

FacebookAds.configure do |config|
  config.access_token = access_token
end

user_data = FacebookAds::ServerSide::UserData.new(email: 'real@email.com')
custom_data = FacebookAds::ServerSide::CustomData.new(currency: 'usd', value: amount)

event = FacebookAds::ServerSide::Event.new(
  event_name: 'Purchase',
  event_time: Time.now.to_i,
  user_data: user_data,
  custom_data: custom_data
)

request = FacebookAds::ServerSide::EventRequest.new(
  pixel_id: pixel_id,
  events: [event]
)

print request

request.execute

Observed Results:

FacebookAds::ClientError ((#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v9.0.: (fbtrace_id: xxxxx))

Expected Results:

The request would succeed and the event would be posted.

jidylle commented 3 years ago

Same issue. HunterHillegas, Do you find a solution ? Thks

HunterHillegas commented 3 years ago

@jidylle I haven't, though I haven't come back to it for a bit. I was hoping someone here might have an answer since either I must be fundamentally doing something wrong or there's some sort of code issue.

jidylle commented 3 years ago

@HunterHillegas For information, updating the gemfile with "facebookbusiness", "~> 0.9.0.0" worked for me.

HunterHillegas commented 3 years ago

That worked for me as well. Thanks!

muthukumar20 commented 3 years ago

The current latest version for Facebook Business SDK is v5.0.5 The current latest version for Graph verison 9.0

GoTo:

vendor/facebook/php-business-sdk/src/FacebookAds/ApiConfig.php
class ApiConfig {
  const APIVersion = '9.0';
  const SDKVersion = '5.0.1';
  const TYPE_CHECKER_STRICT_MODE = false;
}

Change like this