Tracking changes

Information received from the server should be cached (in a local database, in memory, in files on a disk, and so on). This includes parameters of campaigns, groups, ads, and keywords, as well as reference lists of regions and time zones.

You should not get objects from the server again, unless they have actually changed. To check for changes, use the methods for the Changes service:

  • checkDictionaries — Informs you if reference lists have changed.
  • checkCampaigns — Informs you if client campaigns have changed.
  • check — Informs you if a client's campaigns, groups, and ads have changed.
Note. Changes to keywords are considered changes in a group.

We recommend using these methods in the following way:

  1. At the first launch of the app, call the CheckDictionaries method without the Timestamp parameter in order to synchronize the current time.

    The method returns the Timestamp parameter, which is the current UTC time on the server.

  2. In each subsequent method call, indicate the value of the Timestamp parameter that you received in the previous call. This guarantees that there will be no gaps between the intervals for checking for changes, regardless of possible delays or discrepancies between the time on the server and the time in the app.

If you need to check for changes in all campaigns, groups, and ads for a client:

  1. Use the CheckCampaigns method to check which campaigns have changes.

    The method returns the IDs of the campaigns that were changed. The ChangesIn parameter specifies where the changes were made:

    • SELF — In campaign parameters.
    • CHILDREN — In child objects: groups, ads, or keywords.
    • STAT — Corrected campaign statistics (usually related to filtering out false clicks).
  2. If the method showed that there were changes in the campaign's child objects (the CHILDREN value), use the check method to get the IDs of the changed objects. To do this, indicate the campaign ID in the CampaignIds input array, and the AdGroupIds and AdIds values in the FieldNames input array.

If the response indicates changes, get current data by using the get method for the corresponding services — AdGroups or Ads.