Example: Custom Purpose for AdSense
An example of pausing AdSense ad requests in order to wait for the user to consent of a custom purpose.
Note: if you are serving AdSense via DFP Dynamic Allocation, then you don't need to follow these instructions. Our CMP will integrate with DFP
Configuring the custom purpose
This is an example of the configuration you'd provide to your account manager:
|ID||5||ID is chosen to not collide with any other custom purpose used on your site|
|Title||Google AdSense Personalisation||The title you wish to display to the user|
<li><a href="http://example.com/privacy" target="_blank">Technology Partner 1</a></li>
The verbiage is as recommended from https://www.cookiechoices.org/
The list of technology providers is listed in your adsense admin UI. This is required to serve personalized ads.
Integrate on the page
The following code pauses ad requests until the CMP has loaded and had prompted the user. See the google documentation for more details.