How to get updated statistics

Yandex Direct statistics are sometimes updated and added to. The data normally stabilizes within three days.

In unusual cases, older statistics might be corrected. Statistics are usually adjusted when the click rate has declined and the campaign balance has increased, or when there is a shared account.

This means that you might see a discrepancy between the statistics you received earlier and the actual data in Yandex Direct. You can use one of the following approaches to keep your statistics fresh in your database:

Note. Corrections to statistics are usually related to filtering out false clicks. Changes to Yandex Metrica data when using LSC and FC attribution models are not corrections of statistics (see the description of the AttributionModels parameter).

Use the Changes.check method

  1. Run the Changes.check method daily (or on a schedule that you choose) to check whether statistics were adjusted:

    {
      "method": "check",
      "params": { 
        "CampaignIds": [...], /* The campaigns you track statistics for */
        "Timestamp": "...", /* Timestamp you received for the previous method call */
        "FieldNames": ["CampaignsStat"]
      } 
    }

    The method returns the BorderDate parameter for each campaign with statistics that were adjusted after the specified time.

  2. If statistics weren't adjusted, get statistics for the past three days: in the report request, set the DateRangeType parameter to LAST_3_DAYS. Save the new statistics (for yesterday) in your database, and update the existing statistics (for the previous two days).

  3. If statistics were adjusted, get statistics starting from the date in BorderDate up to yesterday's date. Save the new statistics (for yesterday) in your database, and update the existing statistics (for the previous days starting from BorderDate).

Use DataRangeType: AUTO

  1. Get statistics daily by setting DateRangeType to AUTO. The time period for the report is selected automatically, depending on whether or not statistics were adjusted.

    • Not adjusted: the report is created for the past three days.

    • Adjusted — The start date is the earliest date with corrected statistics, and the end date is yesterday's date.

    Show me a diagram

    Tip. Choose a time for running the request that is during the night in Moscow (UTC+3), such as 00:23 or 02:47. Avoid “round” numbers, since the server load peaks at these times.
  2. The first row in the report shows the dates it is for.

    Save or update the statistics for these dates in your database.