Thursday, June 19, 2014

Filtering away archived line items in the DFP API

If you synchronize your line items regularly to a local database using the LineItem.getLineItemsByStatement method, you are hopefully already filtering by LineItem.lastModifiedDateTime and using our other best practices. We want to mention one other best practice that will help you synchronize your line items as quickly as possible.

Recently, DFP has begun to auto-archive old orders. This affects the lastModifiedDateTime field of the line items in the orders. This means that you may suddenly get significantly more line items in one day’s synchronization than in the previous day’s depending on how many orders were auto-archived since your last synchronization. To prevent this, we recommend always filtering by isArchived. For example:

  WHERE lastModifiedDateTime >= '2014-06-01T00:00:00' AND isArchived = false

As always, if you have any suggestions or questions, feel free to drop us a line on our API forums or Ads Developer Google+ page.