GithubHelp home page GithubHelp logo

Comments (11)

kurko avatar kurko commented on April 26, 2024 2

I commented the problematic line,

  module NodeHasNoDelete
    def self.included(base)
      base.class_eval do
        #undef :destroy
      end
    end
  end

I started getting then

NameError:
       uninitialized constant FacebookAds::AdsPixel::SignalsIWLExtractor
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ads_pixel.rb:128:in `block (3 levels) in <class:AdsPixel>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/field_types/enum.rb:25:in `initialize'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/field_types.rb:39:in `new'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/field_types.rb:39:in `for'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/param_set.rb:27:in `has_param'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ads_pixel.rb:128:in `block (2 levels) in <class:AdsPixel>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/edge.rb:157:in `post'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ads_pixel.rb:126:in `block in <class:AdsPixel>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/helpers/edge_helpers.rb:35:in `has_edge'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ads_pixel.rb:122:in `<class:AdsPixel>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ads_pixel.rb:28:in `<module:FacebookAds>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ads_pixel.rb:21:in `<top (required)>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ad_account.rb:562:in `block (3 levels) in <class:AdAccount>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/field_types/enum.rb:25:in `initialize'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/field_types.rb:39:in `new'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/field_types.rb:39:in `for'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/param_set.rb:27:in `has_param'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ad_account.rb:562:in `block (2 levels) in <class:AdAccount>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/edge.rb:149:in `get'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ad_account.rb:561:in `block in <class:AdAccount>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/helpers/edge_helpers.rb:35:in `has_edge'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ad_account.rb:560:in `<class:AdAccount>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ad_account.rb:28:in `<module:FacebookAds>'
     # /Users/alex/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4/lib/facebook_ads/ad_objects/ad_account.rb:21:in `<top (required)>'

Then I look for that class in the project

(5978) ~/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/facebookbusiness-0.3.2.4 (master)
→ ag SignalsIWLExtractor
------------------------------------------------------------------------
lib/facebook_ads/ad_objects/ads_pixel.rb
128:        api.has_param :event_type, { enum: -> { SignalsIWLExtractor::EVENT_TYPE }}
130:        api.has_param :extractor_type, { enum: -> { SignalsIWLExtractor::EXTRACTOR_TYPE }}

There's absolutely no mention of SignalsIWLExtractor definition in the codebase. Googling for that name shows me that the Python, PHP and Java projects have that class defined. I can only imagine that this gem is being auto-generated and no one is caring whether it's working or not.

Is anyone at Facebook really using this gem? Or is it just being auto generated without testing?

from facebook-ruby-business-sdk.

tvillafane avatar tvillafane commented on April 26, 2024

trying bumping to 0.3.2.5 manually, this is some autogenerated code that I tweaked and eventually got it to run:

`
require 'facebook_ads'

access_token = ''
ad_account_id = 'act_
'
app_secret = ''
page_id = '
'
app_id = '**'

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

ad_account = FacebookAds::AdAccount.get(ad_account_id)
campaign = ad_account.campaigns.create({
objective: 'PAGE_LIKES',
status: 'PAUSED',
buying_type: 'AUCTION',
name: 'My Campaign',
})
campaign_id = campaign.id
print 'campaign_id:', campaign_id

ad_set = ad_account.adsets.create({
status: 'PAUSED',
targeting: {'geo_locations':{'countries':['US']}},
daily_budget: '1000',
billing_event: 'IMPRESSIONS',
bid_amount: '20',
campaign_id: campaign_id,
optimization_goal: 'PAGE_LIKES',
promoted_object: {'page_id': page_id},
name: 'My AdSet',
})
ad_set_id = ad_set.id
puts 'ad_set_id:', ad_set_id

creative = ad_account.adcreatives.create({
name: "hi name",
object_story_spec: {
page_id: page_id,
link_data: {
link: "https://www.example.com",
message: "hi mom",
name: "name",
description: "desc",
call_to_action: {
type: 'LEARN_MORE'
}
}
}
})

creative_id = creative.id
puts 'creative_id:', creative_id

ad = ad_account.ads.create({
status: 'PAUSED',
adset_id: ad_set_id,
name: 'My Ad',
creative: {'creative_id':creative_id},
})
ad_id = ad.id
print 'ad_id:', ad_id

ad = FacebookAds::Ad.get(ad_id)
ad.previews({
ad_format: 'DESKTOP_FEED_STANDARD',
})`

pretty embarrassing how much work I had to do to get this to run - but - those are the breaks

from facebook-ruby-business-sdk.

stale avatar stale commented on April 26, 2024

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.

from facebook-ruby-business-sdk.

kurko avatar kurko commented on April 26, 2024

Still waiting for an answer.

from facebook-ruby-business-sdk.

stale avatar stale commented on April 26, 2024

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.

from facebook-ruby-business-sdk.

kurko avatar kurko commented on April 26, 2024

Not fixed.

from facebook-ruby-business-sdk.

walt1020 avatar walt1020 commented on April 26, 2024

@kurko I don't think you are able to destroy AdsPixels through the adaccounts.adspixels edge. https://developers.facebook.com/docs/marketing-api/reference/ad-account/adspixels/.

Instead, assuming what you want to do is remove the pixel from being used by your ad account, you'll want to go in the opposite direction.

If you know the ID of the pixel you want to stop sharing with your ad account, you could possibly do something like

ads_pixel = FacebookAds::AdsPixel.get('YOUR PIXEL ID', YOUR SESSION WITH ACCESS TOKEN)

ad_account = FacebookAds::AdAccount.get('ID OF AD ACCOUNT YOU WANT TO STOP SHARING YOUR PIXEL WITH', YOUR SESSION WITH ACCESS TOKEN)

ads_pixel.shared_accounts.destroy({account_id: ad_account.account_id, business: 'YOUR BUSINESS ID'})

You do need to have the correct permissions to perform this action, however. Hope this helps.

from facebook-ruby-business-sdk.

kurko avatar kurko commented on April 26, 2024

@walt1020 not sure you read my description, but I'm not doing anything related to ad pixels. I'm instantiating an ad account and the code explodes with a stacktrace related to ad pixels.

from facebook-ruby-business-sdk.

walt1020 avatar walt1020 commented on April 26, 2024

@kurko hmm. Are you still using version 0.3.2.4? I've tried replicating your code (using my credentials, not sure if that has anything do with it, but I don't think it would), and it returns my FacebookAds::AdAccount object fine. I'm using version 0.3.3.3.

from facebook-ruby-business-sdk.

stale avatar stale commented on April 26, 2024

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.

from facebook-ruby-business-sdk.

stale avatar stale commented on April 26, 2024

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.

from facebook-ruby-business-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.