Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse version 2 of the ad catalog #5231

Closed
jsecretan opened this issue Jul 12, 2019 · 2 comments · Fixed by brave/brave-core#3980
Closed

Parse version 2 of the ad catalog #5231

jsecretan opened this issue Jul 12, 2019 · 2 comments · Fixed by brave/brave-core#3980
Assignees
Labels
enhancement feature/ads priority/P3 The next thing for us to work on. It'll ride the trains. QA/No release-notes/exclude

Comments

@jsecretan
Copy link

Description

The ad server is providing a v2 of the ad catalog, with some optimization and improvements. This story is to parse the new format, and additional uses thereof will be covered in follow up stories.

  • New URL is at: https://ads-serve.brave.com/v2/catalog.gz
  • Going forward, we should store etag of file and check the etag before downloading a new one
  • The new file is gzipped
  • The fields "budget", "execution" and the campaign name are removed because they are not used by the client
  • Campaign has a new "priority" field
  • Creative Sets have a new field for "oses" if campaigns only make sense on certain platforms. Parse and save for now.
  • Campaign has day parting field

A new example is as follows:

  "version": 1,
  "issuers": [
    {
      "name": "confirmation",
      "publicKey": "jjNJnSb5rIcDh2gdJc4A1lyn3O1uznMFMhCBGtBRhn0="
    },
    {
      "name": "0BAT",
      "publicKey": "0L7b3Fn3Ipr7h0ACM6V8iv0acK90OvcTZwCg9J9kslM="
    },
    {
      "name": "0.05BAT",
      "publicKey": "SFC7j+17aEUfOFlDUGCsYzYIpaALM8gWSe6yd8dsPW4="
    },
    {
      "name": "0.10BAT",
      "publicKey": "tPoMBHA5FvEbKHRXIxe9ZhnpZMPR7/b7ry4n0o3cHno="
    },
    {
      "name": "0.15BAT",
      "publicKey": "IPEIY0oFq5zvT6hJBKLG2TyscolX9H9hq8VgT0Nv01M="
    },
    {
      "name": "0.20BAT",
      "publicKey": "XGh9+XqhVWJo0jORqZPNLii8DpWwHVfKYR/jgjqxY2U="
    },
    {
      "name": "0.25BAT",
      "publicKey": "5ncjvmBTlIbZZOXInr7sLsN60J7qs1bVVVFNsFPrHHk="
    }
  ],
  "ping": 7200000,
  "campaigns": [
    {
      "creativeSets": [
        {
          "creatives": [
            {
              "creativeInstanceId": "e91e5e74-d941-4359-a048-797b5d871025",
              "type": {
                "code": "notification_all_v1",
                "name": "notification",
                "platform": "all",
                "version": 1
              },
              "payload": {
                "body": "quae suscipit iste sed quia vitae consequatur in qui corrupti minima vitae atque dolorum ipsam quia quia deserunt tempora illum",
                "title": "ullam ut voluptatem",
                "targetUrl": "https://bessie.net"
              }
            }
          ],
          "segments": [
            {
              "code": "QFHjRnvPUs",
              "name": "food & drink"
            }
          ],
          "oses": [
            {
              "code": "i1g4cO6Pl",
              "name": "windows"
            }
          ],
          "creativeSetId": "7174cc88-cdda-47c8-b2f4-b94812de2066",
          "perDay": 72,
          "totalMax": 392
        }
      ],
      "dayParts": [
        {
          "dow": "monday",
          "startMinute": "60",
          "endMinute": "120"
        }
      ],
      "geoTargets": [
        {
          "code": "US",
          "name": "United States"
        }
      ],
      "campaignId": "09cc93c9-98d2-4117-ad50-d52e3ef22b76",
      "startAt": "2019-03-31T22:59:27.863Z",
      "endAt": "2020-03-18T06:06:38.190Z",
      "dailyCap": 1,
      "advertiserId": "8ed5123c-ce51-4974-beed-3d8360e735c0",
      "priority": 10
    }
  ],
  "catalogId": "2beaebe0116685afb907f94a2226cb2d51ac2fa6"
}```
@moritzhaller
Copy link

moritzhaller commented Nov 11, 2019

  • Going forward, we should store etag of file and check the etag before downloading a new one

@jsecretan Is this already implemented in ads_serve.cc#L81?

@bsclifton
Copy link
Member

Assigned the Nightly/1.3 milestone as that was missing when brave/brave-core#3980 was merged 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature/ads priority/P3 The next thing for us to work on. It'll ride the trains. QA/No release-notes/exclude
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants