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

No create method for AdSet #74

Closed
mtam2 opened this issue Aug 12, 2019 · 5 comments
Closed

No create method for AdSet #74

mtam2 opened this issue Aug 12, 2019 · 5 comments

Comments

@mtam2
Copy link

mtam2 commented Aug 12, 2019

Which SDK version are you using?

Ruby 2.6.0
facebookbusiness gem from versions 0.3.3.3 to 0.4.0.1

What's the issue?

In versions >0.3.3.2, FacebookAds::AdAccount.get("XXX").adsets has lost the create method.
This example to create an AdSet does not work as a result: https://github.com/facebook/facebook-ruby-business-sdk/blob/master/examples/AdAccountAdSetsPostCreateAdSet.rb

Steps/Sample code to reproduce the issue

Observed Results:

Current traceback

$ gem uninstall facebookbusiness -s
$ gem install facebookbusiness -v 0.4.0.1
$ irb
2.6.0 :001 > require 'facebookbusiness'
 => true 
2.6.0 :002 > act = FacebookAds::AdAccount.get("act_XXXXXXXXXXXXXXXX")
 => #<FacebookAds::AdAccount {:id=>"act_XXXXXXXXXXXXXXXX"}> 
2.6.0 :003 > act.adsets.create({})
Traceback (most recent call last):
        4: from /home/mtamdev/.rvm/rubies/ruby-2.6.0/bin/irb:23:in `<main>'
        3: from /home/mtamdev/.rvm/rubies/ruby-2.6.0/bin/irb:23:in `load'
        2: from /home/mtamdev/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
        1: from (irb):3
NoMethodError (undefined method `create' for #<#<Class:0x00007fffbc0d4e40>:0x00007fffbc3c51b8>)

Expected Results:

Intended traceback

$ gem uninstall facebookbusiness -s
$ gem install facebookbusiness -v 0.3.3.2
$ irb
2.6.0 :001 > require 'facebookbusiness'
 => true
2.6.0 :002 > act = FacebookAds::AdAccount.get("act_XXXXXXXXXXXXXXXX")
 => #<FacebookAds::AdAccount {:id=>"act_XXXXXXXXXXXXXXXX"}>
2.6.0 :003 > act.adsets.create({})
  Traceback (most recent call last):
    9: from /home/mtamdev/.rvm/rubies/ruby-2.6.0/bin/irb:23:in `<main>'
    8: from /home/mtamdev/.rvm/rubies/ruby-2.6.0/bin/irb:23:in `load'
    7: from /home/mtamdev/.rvm/rubies/ruby-2.6.0/lib/ruby/gems/2.6.0/gems/irb-1.0.0/exe/irb:11:in `<top (required)>'
    6: from (irb):3
    5: from /home/mtamdev/.rvm/gems/ruby-2.6.0@dataclover-core/gems/facebookbusiness-0.3.3.2/lib/facebook_ads/edge.rb:95:in `create'
    4: from /home/mtamdev/.rvm/gems/ruby-2.6.0@dataclover-core/gems/facebookbusiness-0.3.3.2/lib/facebook_ads/ad_object.rb:132:in `block (2 levels) in <class:AdObject>'
    3: from /home/mtamdev/.rvm/gems/ruby-2.6.0@dataclover-core/gems/facebookbusiness-0.3.3.2/lib/facebook_ads/api_request.rb:48:in `execute'
    2: from /home/mtamdev/.rvm/gems/ruby-2.6.0@dataclover-core/gems/facebookbusiness-0.3.3.2/lib/facebook_ads/api_request.rb:53:in `execute_now'
    1: from /home/mtamdev/.rvm/gems/ruby-2.6.0@dataclover-core/gems/facebookbusiness-0.3.3.2/lib/facebook_ads/api_request.rb:67:in `create_response'
FacebookAds::ClientError (Invalid parameter: Required Field Is Missing (fbtrace_id: A7woqYlpigEe5jPHM0rA_nw))
@mtam2
Copy link
Author

mtam2 commented Aug 12, 2019

4382861#diff-c81ec6a2f566828f60cc0ebba678537bL473
Y'all changed it to ad_sets from adsets. Please update the all examples accordingly.

@Galaxy83
Copy link

Just waisted 3 hours on this!

Not only it's ad_sets.create, if you need to fetch Ad Sets, you need to change it back to adsets

@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
@mtam2
Copy link
Author

mtam2 commented Jan 14, 2020

Examples still use old deprecated syntax for retrieving an ad_account's adsets. https://github.com/facebook/facebook-ruby-business-sdk/blob/master/examples/AdAccountAdSetsPostCreateAdSet.rb#L32

@stale stale bot removed the Stale label Jan 14, 2020
@mtam2
Copy link
Author

mtam2 commented Apr 4, 2020

Update: the class is now back to ad_account.adsets without the underscore. It only took 3 months but this is back to normal and anyone who is using this gem after 2020-04-01 with version v0.6.0.2 should use adset and NOT ad_set.

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

No branches or pull requests

2 participants