News for Developers

Back to News

PHP Ads API SDK - Oct 1st, 2014 Breaking Changes

Related News

Ads API V2.2 Schedule

December 16 2014

DELETED vs ARCHIVED

September 24 2014

Today we released the facebook-php-ads-sdk v0.9.6. This new version implements full support for the Facebook Ads API Oct 1st, 2014 Breaking Changes. This blog post will walk you through all the code changes required to bring your app up to date.

v0.9.6 also brings additional improvements to the SDK, a complete change-log can be found here.

New Graph API framework conversion

See full details here.

Make sure to remove all reference to deprecated/renamed field name constants.

Ad account GET

New available fields:

  • AdAccountFields::CREATED_TIME

Custom Audiences GET

New available fields:

  • CustomAudienceFields::DATA_SOURCE.
  • CustomAudienceFields::`

IVERY_STATUS. * CustomAudienceFields::OPERATION_STATUS. * CustomAudienceFields::PERMISSION_FOR_ACTIONS`.

Deprecated fields:

  • CustomAudienceFields::PARENT_AUDIENCE_ID
  • CustomAudienceFields::PARENT_CATEGORY
  • CustomAudienceFields::STATUS
  • CustomAudienceFields::TYPE
  • CustomAudienceFields::TYPE_NAME

Deleted/Archive status

See full details here.

  • A new object abstraction layer is available for archivable objects: AbstractArchivableCrudObject.
  • AdCampaign, AdSet and AdGroup now extend from it.

Archivable objects can be archived as follow:

use FacebookAds\Object\AdSet;

$set = new AdSet(123);
$set->archive();
// or
$set->delete();

Custom Audiences API v2

See full details here.

  • CustomAudienceTypes has been updated with the new values. No action should be required.
  • CustomAudienceTypes::CUSTOM_AUDIENCE_THIRD_PARTY_ID has been removed.
  • The argument $type has been removed from the following methods:
    • CustomAudience::addUsers().
    • CustomAudience::removeUsers().
    • CustomAudience::optOutUsers().
  • SHA-256 is automatically enforced whenever email addresses or phone numbers are provided to these methods.
  • CustomAudience::addUsers() and CustomAudience::removeUsers() now returns an array containing information regarding the requested change.

use FacebookAds\Object\CustomAudience;
use FacebookAds\Object\Values\CustomAudienceTypes;

$emails = array(
'luca@example.com',
);

$ca = new CustomAudience(123);
$info = $ca->addUsers($emails, CustomAudienceTypes::EMAIL);

echo 'Facebook successfully received '.$info->num_received
.' entries for custom audience '.$info->audience_id.PHP_EOL;

Rename custom audiences from your website remarketingpixelcode endpoint

See full details here.

  • A new crud object is now available: AdsPixel.
  • AdAccount::getAdsPixels() connection method is now available.

Generalize vat_status field of ad account into tax_id_status

See full details here.

  • AdAccountFields::TAX_ID_STATUS is now available
  • AdAccountFields::VAT_STATUS is still available with an updated value. This will be removed in the next stable release.