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

bid-info values must be positive integers #41

Closed
cornernote opened this issue Nov 25, 2014 · 3 comments
Closed

bid-info values must be positive integers #41

cornernote opened this issue Nov 25, 2014 · 3 comments

Comments

@cornernote
Copy link

My code:

\FacebookAds\Api::init($app_id, $app_secret, $access_token);
$adSet = new \FacebookAds\Object\AdSet(null, $account_id});
$adSet->setData(array(
    \FacebookAds\Object\Fields\AdSetFields::NAME => $name,
    \FacebookAds\Object\Fields\AdSetFields::CAMPAIGN_GROUP_ID => '6017312881528',
    \FacebookAds\Object\Fields\AdSetFields::CAMPAIGN_STATUS => \FacebookAds\Object\AdSet::STATUS_ACTIVE,
    \FacebookAds\Object\Fields\AdSetFields::DAILY_BUDGET => '1',
    \FacebookAds\Object\Fields\AdSetFields::BID_TYPE => 'CPC',
    \FacebookAds\Object\Fields\AdSetFields::BID_INFO => array('CLICKS' => 'min_1_cent'),
    \FacebookAds\Object\Fields\AdSetFields::TARGETING => array(
        'geo_locations' => array('countries' => array('AU')),
    ),
));
$adSet->create();

The error I get is:

exception 'FacebookAds\Http\Exception\AuthorizationException' with message '(#100) bid-info values must be positive integers' in /vagrant/app/vendor/facebook/php-ads-sdk/src/FacebookAds/Http/Exception/RequestException.php:113

The specs say that bid-info should be a JSON object, so I assumed the PHP array should work:
https://developers.facebook.com/docs/reference/ads-api/adset/v2.2

Can you help with the value I should put in here?

Thanks.

@cornernote
Copy link
Author

I should note that I would like to set a max bid of $0.30. If you could assist with that it would be greatly appreciated.

@paulbain
Copy link
Contributor

the min_1_cent in the doc means that the integer value you set must be a least 1, it doesn't mean that there is some enum with the value min_1_cent. The bid value you set is always the maximum you want to pay to set it to 30.

@cornernote
Copy link
Author

ah-ha... thanks

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