Tags: onePPC-dev/facebook-php-ads-sdk
Tags
Fix Issue facebook#223 - Implicit fetch cursor returns empty last value Summary: facebook#223 When using Implicit Fetch the last object returned by Cursor is an empty, inexistant object. This was caused by a very subtle interaction with isJsonObject method. Test Plan: Sample code to detect error: use FacebookAds\Logger\CurlLogger; use FacebookAds\Object\AdAccount; use FacebookAds\Cursor; Api::instance()->setLogger(new CurlLogger()); Cursor::setDefaultUseImplicitFetch(true); $result = array(); $params = array(); $fields = array( \FacebookAds\Object\Fields\AdFields::ID, \FacebookAds\Object\Fields\AdFields::NAME, ); $account = new AdAccount($account_id); $ads = $account->getAds($fields, $params); //$ads->setUseImplicitFetch(true); foreach ($ads as $ad) { $row = []; foreach ($fields as $field) { $row[$field] = $ad->$field; } $result[] = $row; } var_dump($result);
v2.6 Breaking Changes Summary: - Deprecated the `connectionobjects` API which retrieved all object types and replace it with other APIs that return specific object types - Deprecated `max_product_count` since Facebook now automatically optimizes the number of products to show for Dynamic Product ads. In order to opt-out of Carousel format, specify `force_single_link=true`. - Deprecated `product_ad_behavior` field at the Ad Set level - The `fields` parameter no longer accepts breakdowns, such as age or gender. Now you should specified this in 'breakdowns' parameter in query. This includes:- `age`, `country`, `gender`, `frequency_value`,`hourly_stats_aggregated_by_advertiser_time_zone`, `hourly_stats_aggregated_by_audience_time_zone`, `impression_device`, `place_page_id`, `placement`, `product_id`, and `region`This appplies to /insights for all object levels. Test Plan: Run all tests; Alternatively if you want to check specific breaking changes, choose the one's related to it, e.g. for f in docs/*INSIGHTS*; do ./bin/docsmith.php test $f; done for f in docs/*DPA*; do ./bin/docsmith.php test $f; done
Added COUNTRY and EXTERN_ID match support for CA Summary: Added EXTERN_ID support for audience creation. Also known as TPID (Third Party ID), it allows new custom audience creation to allow for an external ID to track their users. This enables updates on certain users without having to re-upload all of the matching PII after the initial step. In addition, this also adds the Country PII matching ability for custom audiences as well, and enforces the 2-digit country code normalization. Test Plan: Ran full test suite, but none of the failures were mine. ./vendor/bin/phpunit -c test/ PHPUnit 4.8.9 by Sebastian Bergmann and contributors. Warning: The Xdebug extension is not loaded No code coverage will be generated. ............................................................... 63 / 143 ( 44%) .........................................E...S.S.S..SSSSSS..... 126 / 143 ( 88%) ESS.S....S...E... Time: 1.3 minutes, Memory: 16.00Mb There were 3 errors: 1) FacebookAdsTest\Object\AdImageTest::testCrud FacebookAds\Http\Exception\AuthorizationException: Service temporarily unavailable Request: DELETE https://graph.facebook.com/v2.5/act_774951135963785/adimages { "hash": "ed3345d875fec7ced81caf3c1f3aee28", "access_token": "EAAFfkefbl1kBAEKtZBufXxlM7eYW6PYXbO57z9sXXefLjzAcJfbs8DHqaoKg3Te5iZCehohvjgfIRg20DR6VG70Ny0PmLxR42HexOZA244Oro5pCxwkWsQZC1GZALTtVcZBmtd8wKIP52DOHoKZCLDaZAoQkUozMwZAZBSKx1471e46wZDZD", "appsecret_proof": "b0695b49532952119ab907539774646f04abaf14b7c8832e9d57d7f09f67b7e5" } HTTP status Code: 400 Is transient: false Code: 2 Error Subcode: 1487497 Error User Title: Failed to delete the account image Error User Message: Failed to delete account image: Image with hash ed3345d875fec7ced81caf3c1f3aee28 is still being used by creative(s) with ID(s) 6044679174671 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Exception/RequestException.php:163 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Client.php:217 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Request.php:282 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Api.php:152 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Api.php:194 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Object/AbstractCrudObject.php:311 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Object/AdImage.php:164 /Users/alexlupu/sdk/php-ads-sdk/test/FacebookAdsTest/Object/AbstractCrudObjectTestCase.php:251 /Users/alexlupu/sdk/php-ads-sdk/test/FacebookAdsTest/Object/AdImageTest.php:38 2) FacebookAdsTest\Object\DynamicProductAdsAdvertTest::testDynamicProductAdsCreation FacebookAds\Http\Exception\AuthorizationException: Invalid parameter Request: POST https://graph.facebook.com/v2.5/act_774951135963785/ads { "name": "DPA Test Ad 1 c8560f55ac98b8c75201f49dade0f01b", "adset_id": "6045144296071", "creative": { "creative_id": "6045144306871" }, "redownload": true, "access_token": "EAAFfkefbl1kBAEKtZBufXxlM7eYW6PYXbO57z9sXXefLjzAcJfbs8DHqaoKg3Te5iZCehohvjgfIRg20DR6VG70Ny0PmLxR42HexOZA244Oro5pCxwkWsQZC1GZALTtVcZBmtd8wKIP52DOHoKZCLDaZAoQkUozMwZAZBSKx1471e46wZDZD", "appsecret_proof": "b0695b49532952119ab907539774646f04abaf14b7c8832e9d57d7f09f67b7e5" } HTTP status Code: 400 Is transient: false Code: 100 Error Subcode: 1359101 Error User Title: Add Payment Method Error User Message: You need to have a valid payment method associated with your ad account before you can create ads. Error Blame Fields: account_id /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Exception/RequestException.php:163 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Client.php:217 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Request.php:282 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Api.php:152 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Api.php:194 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Object/AbstractCrudObject.php:236 /Users/alexlupu/sdk/php-ads-sdk/test/FacebookAdsTest/Object/AbstractCrudObjectTestCase.php:52 /Users/alexlupu/sdk/php-ads-sdk/test/FacebookAdsTest/Object/DynamicProductAdsAdvertTest.php:254 3) FacebookAdsTest\Object\ReachFrequencyPredictionTest::testCrudAccess FacebookAds\Http\Exception\AuthorizationException: An unknown error has occurred. Request: DELETE https://graph.facebook.com/v2.5/6045144318271 { "access_token": "EAAFfkefbl1kBAEKtZBufXxlM7eYW6PYXbO57z9sXXefLjzAcJfbs8DHqaoKg3Te5iZCehohvjgfIRg20DR6VG70Ny0PmLxR42HexOZA244Oro5pCxwkWsQZC1GZALTtVcZBmtd8wKIP52DOHoKZCLDaZAoQkUozMwZAZBSKx1471e46wZDZD", "appsecret_proof": "b0695b49532952119ab907539774646f04abaf14b7c8832e9d57d7f09f67b7e5" } HTTP status Code: 500 Is transient: false Code: 1 Error Subcode: Error User Title: Error User Message: /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Exception/RequestException.php:163 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Client.php:217 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Http/Request.php:282 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Api.php:152 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Api.php:194 /Users/alexlupu/sdk/php-ads-sdk/src/FacebookAds/Object/AbstractCrudObject.php:311 /Users/alexlupu/sdk/php-ads-sdk/test/FacebookAdsTest/Object/AbstractCrudObjectTestCase.php:251 /Users/alexlupu/sdk/php-ads-sdk/test/FacebookAdsTest/Object/ReachFrequencyPredictionTest.php:73 FAILURES! Tests: 143, Assertions: 592, Errors: 3, Skipped: 13. My particulars were: ./vendor/bin/phpunit -c test/ ./test/FacebookAdsTest/Object/CustomAudienceMultikeyTest.php PHPUnit 4.8.9 by Sebastian Bergmann and contributors. Warning: The Xdebug extension is not loaded No code coverage will be generated. .. Time: 4.86 seconds, Memory: 5.50Mb
PreviousNext