Skip to main content

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Using Event Tracking to create action-based audiences in Google Ads

Suggest edit Updated on October 7, 2021
Note: This article describes Paid Media Manager as implemented with Pega Customer Decision Hub™ 8.5 or earlier. For Pega Customer Decision Hub 8.6, see Generating Next-Best-Action web audiences with Paid Media Manager.

This tutorial describes how to customize a Google Analytics Event to include the information required by the Paid Web Service, and how to convert an Event into a people-based audience.

  1. Log in to Google Analytics. If required, sign up for a new Google Analytics account.
  2. In the Admin panel, click Tracking Info > Tracking Code and take note of the ID in the Tracking ID field.
  3. In the Global Site Tag field, copy the Global Site Tag tracking code.
    "Global Side Tag and Tracking ID"
    Global Side Tag and Tracking ID
  4. Work with your web team to add the Global Site Tag tracking code to the <HEAD> element of every website where you want to track visitor activity. After implementing this tag, you can monitor site visitors on the Home page of Google Analytics.
  5. In Google Analytics, in the Admin panel, click Tracking Info > Data Collection.
  6. Set the Remarketing andAdvertising Reporting featurestoggles to ON.
    "Data Collection page in Google Analytics"
    Data Collection page in Google Analytics
  7. In the Admin panel, click Product Linking > Google Ads Linking.
  8. Select your Google Ads account or create one with the same email as the one that you used for the Google Analytics account.
    "Selecting the account"
    Selecting the account
  9. Click Continue.
  10. Set the All Website Data toggle to ON.
  11. Click Link account.
  12. Work with your web team to add the pixel to your website. To help you configure the Pixel, see Sample Javascript to send Next-Best-Actions to the advertising pixelMake sure to include the following lines in the <script> section of the pixel code:
    gtag('js', new Date());
    gtag('config', '<your global site tag tracking code>');// In the Admin panel, click Tracking Info > Tracking Code and take note of the ID in the Tracking ID field.
    gtag('event', '<your event action>', { // event action could be Page View, click, download etc.
    'send_to': '<your global site tag tracking code>',
    'event_category': '<event category>',
    'event_label': '<event label>'

    The value of the <Event Label> parameter is provided by the AudienceName parameter from the PaidAudiencesContainer REST service. This service returns a list of all paid audiences to which an individual belongs, that is, the latest actions selected for the individual by the Next-Best-Action strategy. For more information about the PaidAudiencesContainer REST service and its parameters, see "PaidAudiencesContainer REST service" in the Pega Marketing or Pega Customer Decision Hub User Guide.
  13. To verify that the pixel is correctly configured, generate some website traffic, and then log in to Google Analytics and click Realtime > Events.
    Note that there might be a delay of several minutes before the events are created.
  14. To use the Event data in your targeting, convert the events to Google Ads audiences:
    1. In the Admin panel of Google Analytics, click Audience Definitions > Audiences.
    2. Click New Audience > Create New.
      "Create a new audience in Google Analytics"
      Create a new audience in Google Analytics
    3. Click Conditions and select your custom Google Analytics Event by its Event Label, that is, the name of the paid audience to which an individual belongs in Paid Media Manager.
      "Selecting the Google Analytics Event"
      Selecting the Google Analytics Event
    4. Add any other required conditions and select the Google Ads account where the audience should be created.
      "Selecting the destination"
      Selecting the destination
    5. Click Publish.


You have implemented pixel-based APIs for two paid destinations. You can now leverage the full fidelity of enterprise data and intelligence to communicate the individual's Next-Best-Action to paid platforms, considering not only their last interaction on a website, but also data about known individuals' interactions with your ads. In this way, you can maximize your opportunities to target individuals with ads based on their Next-Best-Action.

Did you find this content helpful? YesNo

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us