Wednesday, November 6, 2013

Google Ads Developer Blog

Google Ads Developer Blog


New Google Mobile Ads SDK for iOS Includes Support for 64 bit iOS devices

Posted: 05 Nov 2013 02:53 PM PST

Today, we're excited to announce version 6.6.0 of the iOS Google Mobile Ads SDK. Highlights include:

  • Added support for arm64 and x86_64 architectures
  • Significantly reduced library size
  • Added adNetworkClassName property on GADBannerView and GADInterstitial
  • Fixed a bug where DFP app events were not firing for interstitials

The new adNetworkClassName property tells you which ad network class served an ad during mediation. This value will be GADMAdapterGoogleAdMobAds for ads coming from the AdMob or DFP network, and GADMAdapterCustomEvents for custom event classes. For other ad networks, this property will return their adapter's class name.

Check out the release notes for a full list of updates. The latest SDK can be found on our downloads page. You can reach us on our forum with any questions or concerns about the new SDK, and stay tuned for updates on our Google+ page.

Introducing support for Budgets in AdWords Scripts

Posted: 05 Nov 2013 11:48 AM PST

We are glad to announce that AdWords Scripts now support Budgets as top-level objects. You can now fetch the budget's stats, determine whether it is shared, and inspect its delivery method. You can also fetch all campaigns associated with a budget.

To support budgets, we have had to tweak existing APIs a bit. We believe the impact on existing scripts will be minimal; please let us know if you experience any issues, and we'll help you work through them. Here's what changed: The good news - existing scripts should be largely unaffected by this change. Details below.

Campaign.getBudget()

Thanks to JavaScript flexibility, the same entity can act as both a Number and an Object. Consider this snippet:
  var smartNumber = new Number(48.0);  smartNumber.getIQ = function() { return 150; } // indeed, a smart number!    // smartNumber acts like a regular number:  Logger.log(smartNumber);         // prints '48.0'  Logger.log(smartNumber + 5);     // prints '53.0'  Logger.log(smartNumber > 47);    // prints 'true'    // and you can also call its methods  Logger.log(smartNumber.getIQ()); // prints '150'  
We have used a similar approach for the return value of Campaign.getBudget() method. The value returned from that method acts like a number (and thus existing scripts shouldn't be affected), but also exposes methods from Budget object (getStats(), getDeliveryMethod(), etc.)

The behavior observed by your script may change in the following (unlikely) scenarios:
  • typeof operator - 'object' vs. 'number'
Type of the object returned by getBudget() call has changed from 'number' to 'object':
  Logger.log(typeof(21));             // prints 'number'  Logger.log(typeof(smartNumber));    // prints 'object'  
  • === operator
If used for comparison of budget values, the triple-equals operator will now return false instead of true:
  Logger.log(smartNumber == 48);      // prints 'true'  Logger.log(smartNumber === 48);     // prints 'false'  
Campaign.setBudget(Number)

We are deprecating this method. The preferred way to change a campaign's budget, going forward, is via the Campaign.getBudget().setAmount() call.

Campaign.setBudget(Number) will continue working for non-shared budgets in the short term. For explicitly shared budgets, however, the call to this method will throw an exception (while in the past, it would log an error and proceed with the execution).

Happy scripting!

No comments:

Post a Comment