Advertiser Examples

1. Update a bid

Query
Result
mutation {
  updateAdSet(input: {
    id: "00000000-0000-0000-0000-000000000000",
    bidding: {amount: 1000000}
  }) {
    adSet {
      id
    }
  }
}

Note that the bid amount in this case is represented in micros. For more information, see the documentation for the Money scalar type.

2. Look up ad sets

No filtering

Query
Result
query {
  advertiser {
    adSets(first: 50) {
      edges {
        node {
          id
          bidding {
            amount
          }
          campaign {
            objective
          }
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

Note that you can use the endCursor from the above response to request the next page. For example:

Query
Result
query {
  advertiser {
    adSets(first: 50, after: "Mg==") {
      edges {
        node {
          id
          bidding {
            amount
          }
          campaign {
            objective
          }
        }
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

With filtering

Query
Result
query {
  advertiser {
    adSets(first: 50, configuredStatus: ACTIVE) {
      edges {
        node {
          id
        }
      }
    }
  }
}

3. Look up insights

No breakdown

Query
Result
query {
  adSet(id: "00000000-0000-0000-0000-000000000000") {
    insights(timeRange: {from: "2018-03-06T00:00:00Z", until: "2018-03-07T00:00:00Z"}) {
      timestamps
      reports {
        impressions
        conversions
        spend
      }
    }
  }
}

Breakdown by country

Query
Result
query {
  adSet(id: "00000000-0000-0000-0000-000000000000") {
    insights(timePreset: TODAY) {
      reports {
        country
        impressions
        conversions
        spend
      }
    }
  }
}

Breakdown by Ad and Publisher App

Note: Data before October 15th, 2018 will not have an app associated with it. In this case, "app" will simply be "null" (example in the results tab).

Note: bundleId and storeId are only available after contacting Tapjoy. hashedId is an encrypted unique identifier for each app.

Query
Result
query {
  adSet(id: "00000000-0000-0000-0000-000000000000") {
    ads {
      id
      insights(timePreset: TODAY) {
        reports {
          app {
            bundleId
            hashedId
          }
          impressions
          conversions
          spend
        }
      }
    }
  }
}

Across all Ad Sets

Query
Result
query {
  advertiser {
    adSets(first: 50, configuredStatus: ACTIVE) {
      edges {
        node {
          id

          insights(timeRange: {from: "2018-03-06T00:00:00Z", until: "2018-03-07T00:00:00Z"}) {
            timestamps
            reports {
              conversions
              spend
            }
          }
        }
      }
    }
  }
}

4. Look up user time zones

Note that utcOffset is +/- the number of hours and minutes that the time zone is from UTC. If the time zone is UTC, it will be returned as +00:00.

Additionally, information will change based on if the time zone is currently experiencing daylight savings time. For example you may see EDT or EST for Eastern Time's abbreviation.

Query
Result
query {
  user {
    firstName
    lastName

    timeZone {
      utcOffset
      name
      abbreviation
    }
  }
}

5. Look up configured events

This lists all multiRewardEngagementEvents on an adset, regardless of bid amount, status, or number of conversions.

Query
Result
{
  adSet(id: "ace4b134-c5ab-4e97-bc81-95406682682c") {
    multiRewardEngagementSettings {
      events {
        eventName
        eventValue
        amount
      }
    }
  }
}

6. Create and delete events

Creating and deleting MultiRewardEngagementEvents is done in a single mutation. You must provide an AdSet id as well as a list of at least two MultiRewardEngagementEvents.

To disable an event, add the disable: true attribute. eventName and eventValue are still required when disabling events to prevent accidental deletions.

In the following example, we'll configure our AdSet to have two events: TUTORIAL_COMPLETE and LEVEL_ONE. We'll also disable the LEVEL_TWO event.

Query
Result
mutation {
  updateAdSetBidding(
    input:{
      id: "<your adset id>"
      bidding: {
        multiRewardEngagementEvents: [
          {
            eventName:"TUTORIAL_COMPLETE",
            eventValue: "",
            amount: 2200000
          },
          {
            eventName:"LEVEL_ONE",
            eventValue: "",
            amount: 12200000
          },
          {
            eventName:"LEVEL_TWO",
            eventValue: "",
            disable: true
          }
        ]
      }
    }
  ) {
    bidding {
      multiRewardEngagementEvents {
        eventName
        eventValue
        amount
      }
    }
  }
}

7. Look up per-app event configurations

This lists all multiRewardEngagementEvents data on an adSet, including publisher-app-specific bid settings. Non-publisher-app-specific event configurations will be listed under the null app.

Query
Result
{
  adSet(id: "ace4b134-c5ab-4e97-bc81-95406682682c") {
    multiRewardEngagementSettings {
      app {
        bundleId
      }
      events {
        eventName
        eventValue
        amount
      }
    }
  }
}

8. Create and delete per-app event configurations

Just like MultiRewardEngagementEvents, creating and deleting AppBiddingGroups is done in a single mutation. You must provide at least one publisher AppReference id as well as a list of at least two MultiRewardEngagementEvents. The amount for these events will be used in place of the top-level configured values when a conversion happens inside the given publisher AppReference.

To disable an event or per-app-bid group, add disable: true to the object. Disabling a per-app-bid group automatically disables its' children events. eventName and eventValue are required when disabling events to prevent accidental deletions.

In the following example, we'll configure our AdSet to have two events: TUTORIAL_COMPLETE and LEVEL_ONE. For the each of these we will configure a bid value of $2.2 and $12.2, respectively. This will be the amount used for all apps by default. We will also disable an event, LEVEL_TWO.

Next, for Example Publisher App 1, we will instead use bid values of $5.5 for the first event, and disable any custom bid for the second.

Finally, for Example Publisher App 2, will will disable the group entirely, which will disable all events as well.

Query
Result
mutation {
  updateAdSetBidding(
    input:{
      id: "<your adset id>"
      bidding: {
        perAppBidGroups: [{
          pubAppId:"<example_publisher_app_id>"
          multiRewardEngagementEvents: [
            {
              eventName:"TUTORIAL_COMPLETE",
              eventValue: "",
              amount: 5500000
            },
            {
              eventName:"LEVEL_ONE",
              eventValue: "",
              disable: true,
            }  
          ]
        },
        {
          pubAppId:"<example_publisher_app_id_2>",
          disable: true
        }],
        multiRewardEngagementEvents: [
          {
            eventName:"TUTORIAL_COMPLETE",
            eventValue: "",
            amount: 2200000
          },
          {
            eventName:"LEVEL_ONE",
            eventValue: "",
            amount: 12200000
          },
          {
            eventName:"LEVEL_TWO",
            eventValue: "",
            disable: true
          }
        ]
      }
    }
  ) {
    bidding {
      multiRewardEngagementEvents {
        eventName
        eventValue
        amount
      }
      perAppBidGroups {
          pubApp {
            id
            name
          }
        }
        multiRewardEngagementEvents {
          eventName
          eventValue
          amount
      }
    }
  }
}