Remarketing Audiences Developer Guide

This document describes how to use the Management API to manage Google Analytics remarketing audiences.

Introduction

The Management API allows you to create, get, delete, list, update and patch remarketing audiences for a Google Analytics property. To learn more about how remarketing audiences work, see the About Remarketing Audiences in Analytics help center article.

Use cases

The Remarketing Audience resource supports get, delete, list, patch, and update, but the key use cases are:

List remarketing audiences

To list all remarketing audiences for a property:

  1. Use the Management API or Account Explorer to retrieve the accountId and webPropertyId.
  2. Execute the list method of the Remarketing Audiences resource.

See the API reference for details of the list method for remarketing audience resource.

Create a new remarketing audience

To create a new remarketing audience for a property:

  1. Use the Management API or Account Explorer to retrieve the accountId and webPropertyId.
  2. Use the Management API or Account Explorer to retrieve the view (profile) Id for the linkedViews [] property.
  3. Use the Google Ads Linkscollection to retrieve an Google Ads account Id for the linkedAdAccounts.linkedAccountId.
    • The linkedAdAccounts[] property is currently limited to only one linkedForeignAccount.
    • The linkedAdAccounts[].type can be set to ADWORDS_LINKS, DBM_LINKS, MCC_LINKS or OPTIMIZE.
  4. Use the Segments collection for options to set the segment property of the includeConditions, and if creating a state based audience do the same for the excludeConditions. Also see the segments reference for defining a segment.
  5. Execute the insert method of the Remarketing Audience resource.

The API allows you to create two types of audiences: SIMPLE and STATE_BASED. For SIMPLE audiences you need only construct the audienceDefinition with a positive segment, without a NOT operator (the ! character). Should you want to include an exclude condition you must define a statebasedDefinition; see State Based Audiences to learn more. See the reference example for details.

Update an existing remarketing audience

To update an existing remarketing audience for a property:

  1. If you already have the Remarketing Audience ID you can call get, otherwise you can call the list and select the audience you wish to update.
  2. Update any of the writable fields and call update passing in the updated audience object.