In Google Analytics 360 when creating an audience you can only link this to 10 destinations. This makes the process very manual and repetitive when a client has many destinations, as a different audience needs to be created for each batch of 10 destinations.
This is an app script solution designed to solve this challenge.
- A user creates an audience in the Google Analytics UI.
- The user copies the URL to a Google Sheet.
- The user list the destination IDs to copy the audience to.
- The user runs
runAudienceCreator()
, which:- Extracts the audience ID from the URL.
- Fetches that audience from the API.
- Fetches the destinations from the Google Sheet.
- Creates a copy of the original audience for each batch of 10 destinations.
- Logs the outputs in the Google Sheet.
(Optionally) the deleteAudiencesInLog()
method can be used to delete all
audiences logged in the output.
- Create a copy of the template Google Sheet.
- Go to Tools -> Script Editor to open the App Script Editor.
- Create a new script file and copy the content of
app_script.js
to this. - Go to Resources -> Cloud Platform Project and add your Google Cloud Project.
- In your Google Cloud Project enable the Google Analytics API.
- Go to Resources -> Advanced Google Services -> Enable the "Google Analytics API".
- Create an audience in the Google Analytics UI.
- Copy the URL to that audience to cell A2 in the Config sheet.
- List the destination IDs in column B.
- Select the type of destination in column C.
- Press the "Create Audiences" button.
The following are known limitations of the current implementation:
- You cannot copy an audience from one property and link it to destinations on another property.
This is not an officially supported Google product.