Google API access

This document describes how to give API access to your Google Ad Manager (GAM) account (previously called DFP), how to add Advertser and how to export Ad Units. Full manual is also available as PDF document: https://cp.headbidder.net/docs/GAM_API_access_and_ad_spots_export.pdf?1580198244

1. At the frst step, you need to create “Key File”.

Go here to do that: Google APIs https://console.developers.google.com/iam-admin/serviceaccounts

1.1. Create “New Project” by clicking Create and give a name Ex.: My Project 65193.

1.2. Then, by using a form Create service account fll Service account name, Ex.: DFP Integraton. In the feld Role choose Project -> Browser. Select opton - Furnish a new private key and then choose Key Type -JSON. Click Create. After that a json-key file will be downloaded to your computer. Keep it for further steps.

1.3. At the page Service Accounts copy Service Account ID. Ex.: dfp-integraton@vaulted-harbor-12345678.iam.gserviceaccount.com. Keep it together with key fle for further steps.

2. Go to your Google Ad Manager (GAM) account.

2.1. Go to Admin -> Global Settings and select API access, click on Add a service account user after that. In the form enter a User Name, Ex.: Google API Integration. In the field Email and Confirm Email paste Service Account ID copied at the step 1.3. In the field Role select Administrator (DFP only) option. ClickSave.

3. Go to Admin -> Companies -> Advertisers and add a New Company -> Advertiser. Give a Name and click Save. Under the new Advertser name you’ll be creatng Header Bidding Manager Orders and Line Items.

4. Go to Inventory -> Ad Units -> Generate tags and Select ad units by clicking Include. Selected Ad Units will appear on the right side of the table then. Click Generate Tags.

At the next screen, click Continue, disable Single request and click Contnue again. Now you see tags for Page Head and Page Body. Repeat step for all ad units that you wish to use with header bidding setup and copy everything into a .txt file on your computer. Head part of script is required for the next step.

Important note about Ad Units.

Google Ad Manager allows building an Ad Units hierarchy [https://support.google.com/dfpppremium/answer/0220n38?0hl=en], i.e. Ad Unit 1 stays on top of Ad Unit 2 and Ad Unit 3, we suggest, DO NOT USE such structure together with prebid if possible. As Google suggests, please use Top-Level Ad Units only.

But, if that is absolutely necessary to use sub-levels make sure to add into Top-Level Ad Unit all the Ad Sizes that are used on underlying (lower) levels. i.e. Level-Two Ad Units:  Ad Unit 2 [322x252] and Ad Unit 3 [102x022, 122x022], Top-Level Ad Unit: Ad Unit 1 [322x252, 102x022, 122x022]

Important note about Ad Units.

Due to the latest changes in the GAM interface, you could not create several ad tags for several ad units at once anymore. That’s not a major issue. You may build full script yourself or use third party service like: DFP Tag Generator & Tester *Beta at URL: [http://dfpgpt.appspot.com/]

Now you have two fles which required for automatc Line Item creaton. Upload one in an appropriate dialogue at the Head Bidder site, use <head> tag for Ad Zone creaton, use Advertser name. Head Bidder Manager will create Line Items, Creatves and Prebid wrapper so you’ll be able to use Prebid.js together with your GAM account, get stats in HeadBidder interface and send winning bids to GAM. Later that is possible to add more ad units into header bidding setup if needed, add or remove sizes.