

# Integrating AWS Elemental MediaTailor with Google Ad Manager
<a name="gam-integration"></a>

Integrate MediaTailor with [Google Ad Manager](https://admanager.google.com/home/) (Ad Manager) for programmatic access to an online, auction-driven marketplace where ad impressions can be bought and sold in real time. You must have an account set up with Ad Manager, then you can integrate with Ad Manager in the following ways:
+ A server-side integration using an SSL certificate. 
+ A client-side player integration using the Programmatic Access Libraries (PAL) SDK. This integration is required if you want to use the open auction transaction type.

Ad Manager support for programmatic transaction types varies based on the type of integration that you're using. For a list of available options, see [Transaction types](https://support.google.com/admanager/answer/2805834?hl=en) or contact your Google account team. 

The following sections describe these integrations in detail.

**Topics**
+ [Server-side integration](gam-integration-ssl.md)
+ [Client-side integration](gam-integration-pal.md)

# Server-side AWS Elemental MediaTailor integration with Google Ad Manager
<a name="gam-integration-ssl"></a>

Server-side ad requests to Google Ad Manager (Ad Manager) must include the SSL certificate that Ad Manager has issued to MediaTailor to authorize programmatic transactions. 

**To make server-side ad requests to Ad Manager**

1. [Submit an AWS Support ticket](https://console.aws.amazon.com/support/home#/) to request SSL certificates to be enabled. Include the following information in the Support ticket:
   + AWS Region
   + AWS account ID
   + MediaTailor playback configuration name

   If you don't enable SSL certificates, Ad Manager responds to MediaTailor ad requests with HTTP 401 error codes in the `ERROR_ADS_INVALID_RESPONSE` ADS interaction log event type.

1. After SSL certificates are enabled, update the URL and parameters for your ADS and preroll ADS in the playback configuration. To update or create a playback configuration, see [MediaTailor playback configuration management](working-with-configurations.md).

   For official guidance on VAST ad request URL parameters for Ad Manager, see the Ad Manager [Server-side implementation guide.](https://support.google.com/admanager/answer/10668760) Updating includes the following changes:
   + Change the base URL from `pubads.g.doubleclick.net` to `serverside.doubleclick.net`.
   + Add the parameter `ssss=mediatailor`. This indicates that MediaTailor is the server-side stitching source.
   + Remove the `IP` parameter. MediaTailor automatically passes in the end-user IP address using the `X-Forwarded-For` header.
   + Remove the `ss_req=1` parameter.

   For updated and complete VAST URL guidance, see the [Server-side implementation guide](https://support.google.com/admanager/answer/10668760) or contact your Google account team. 

# Client-side AWS Elemental MediaTailor integration with Google Ad Manager
<a name="gam-integration-pal"></a>

A MediaTailor client-side integration is required to use the Google Ad Manager Programmatic Access Libraries (PAL) SDKs. This integration is required if you want to use Ad Manager's open auction transaction type. 

The PAL SDKs provide information about the content, device, and user data for a playback session. Through the PAL SDK, you can provide this information to Google Ad Manager, which can then make better determinations of what targeted ads to show. SDKs are available for Android, iOS, HTML5, and Cast. For information about using the PAL SDKs, see [Google Ad Manager PAL SDK](https://developers.google.com/ad-manager/pal). 

**To create client-side integration with Ad Manager**

1. Use the PAL SDK to generate a nonce. 

   The nonce is an encrypted string that PAL generates for stream requests. Each request must have a unique nonce. For information about setting up a nonce, choose your SDK from [Google Ad Manager PAL SDK](https://developers.google.com/ad-manager/pal).

1. Use the `givn` parameter in your ADS request to pass through the nonce value. To do this, update your ADS URL to include `&givn=[player_params.givn]`. For instructions, see [Enabling client-side tracking](ad-reporting-client-side.md#ad-reporting-client-side-enabling).

**Datazoom player SDKs**  
MediaTailor has partnered with Datazoom to provide free player SDKs to ease integrations with SDKs such as those offered in the Ad Manager PAL. For information about the Datazoom and MediaTailor partnership, see [Datazoom free player SDKs](ad-reporting-client-side-ad-tracking-integrations.md#ad-reporting-client-side-ad-tracking-integrations-dz).

To access the Datazoom player SDKs, use the contact information on the [Datazoom with AWS](https://www.datazoom.io/partner-aws) site. 