facebook-python-business-sdk icon indicating copy to clipboard operation
facebook-python-business-sdk copied to clipboard

ProductAudienceFields

Open rooislangwtf opened this issue 11 years ago • 2 comments

I got an "Undefined class constant 'RETENTION_SECONDS'" error using the following code: $audience = new ProductAudience(null, 'act_<ACCOUNT_ID>'); $audience->setData(array( ProductAudienceFields::NAME => 'Product Audience', ProductAudienceFields::PRODUCT_SET_ID => '<PRODUCT_SET_ID>', ProductAudienceFields::PIXEL_ID => '<PIXEL_ID>', ProductAudienceFields::INCLUSIONS => array(array( ProductAudienceFields::RETENTION_SECONDS => 1296000, ProductAudienceFields::RULE => array( 'event'=>array('eq'=>'ViewContent') ) )) )); $audience->save();

I managed to fix it by adding the following constants to the ProductAudienceFields abstract class of ProductAudienceFields.php file in FacebookAds\Object\Fields : const RETENTION_SECONDS = 'retention_seconds'; const RULE = 'rule';

rooislangwtf avatar May 07 '15 11:05 rooislangwtf

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

ghost avatar Aug 04 '15 18:08 ghost

This looks like a PHP SDK issue. Please open an issue under- https://github.com/facebook/facebook-php-ads-sdk

rituparnamukherjee avatar Sep 03 '15 21:09 rituparnamukherjee