Audiences from your app

Overview

Custom Audience from your app allows you to target people who have taken specific actions in your mobile app, such as achieving a level in a game or placing an item in the shopping cart.

To create custom audiences from your app, you need to use one of Gemini’s measurement partners and configure their SDK to log the events you want Gemini to use for audience building. Once your measurement SDK starts passing Gemini in-app events, you will be able to start running ads that target these audiences.

Fields

Audiences from your app have the following fields:

Name Description Type Add Update
id The unique identifier of the audience. long N/A Required
advertiserId The id of the advertiser that owns the audience. long Required N/A
tagid Before in-app audiences can be created, you must generate a tag for the account as detailed here. All you need is the id of the tag. long Required Read-Only
name The name of the audience segment. Maximum is 255 characters. string Required Optional
description A description for the segment. Maximum is 255 characters. string Optional Optional
type The custom audience type. Must be set to MOBILEAPP and cannot be changed once set. enum Required Required
prefill TRUE means including traffic logged prior to the audience creation. Will default to FALSE if not set. boolean Optional Optional
rule Rules determine whether the user should be added to an audience. A user will be added to the audience within 5 minutes of taking the specified action in your app. See the managing rules section for more details. Note that for MOBILEAPP audiences, { “ai”:{ “eq”:“<app store id>” } must be part of the rule. See example below for details. JSON object Required Optional
retentionDays Number of days the user will remain in an audience. Accepts values between 1 and 30 and will default to 30 if not specified. int Optional Optional
cnt24h Unique user count for the last 24 hours. long Read-Only Read-Only
cnt30d Unique user count for the last 30 days. long Read-Only Read-Only
status The status of the segment. Can be ACTIVE or DELETED, and is set to ACTIVE by default. enum Optional Optional

Endpoint

Resource URI

https://api.gemini.yahoo.com/v3/rest/audience/

Create a new audience

Method: To create a new audience from your mobile app, make a POST call to the audience endpoint with the required fields. Batch create is supported. The response will be the newly created audience, or a list of multiple new audiences if an array is passed. Note that for MOBILEAPP audiences, { “ai”:{ “eq”:”<app store id>” } must be part of the rule.

For example:

POST https://api.gemini.yahoo.com/v3/rest/audience

   Data passed

              {
                  "name": "People who are interested in my demo",
                  "type": "MOBILEAPP",
                  "advertiserId": 1106910,
                  "tagId": 419766,
                  "rule": {
                      "and": [
                          {
                              "ai": {
                                  "eq": "628677149"
                              }
                          },
                          {
                              "ec": {
                                  "eq": "button"
                              }
                          },
                          {
                              "ea": {
                                  "eq": "click"
                              }
                          },
                          {
                              "el": {
                                  "eq": "Product demo"
                              }
                          },
                          {
                              "ev": {
                                  "gt": 5
                              }
                          }
                      ]
                  },
                  "retentionDays": "30",
                  "prefill": "FALSE"
              }




      Example response

      {
          "errors": null,
          "timestamp": "2015-10-10 1:33:56",
          "response": {
              "type": "MOBILEAPP",
              "id": 20525235,
              "advertiserId": 1106910,
              "name": "People who are intested in my demo",
              "description": null,
              "retentionDays": 30,
              "status": "ACTIVE",
              "rule": {
                  "and": [
                      {
                          "ai": {
                              "eq": "628677149"
                          }
                      },
                      {
                          "ec": {
                              "eq": "button"
                          }
                      },
                      {
                          "ea": {
                              "eq": "click"
                          }
                      },
                      {
                          "el": {
                              "eq": "Product demo"
                          }
                      },
                      {
                          "ev": {
                              "gt": 5
                          }
                      }
                  ]
              },
              "prefill": "FALSE",
              "tagId": 419766
          }
      }