Example: Custom Purpose for Google Analytics
An example of delaying the loading of Google Analytics until the user to consents to a custom purpose.
Note: You may not need to gather consent for Google Analytics if you are not collecting User IDs or other pseudonymous identifiers. We found this article helpful in explaining.
Configuring the custom purpose
This is an example of the configuration you'd provide to your account manager:
|ID||6||ID is chosen to not collide with any other custom purpose used on your site|
|Title||Google Analytics||The title you wish to display to the user|
The description you wish to show
Integrate on the page
The following code delays loading until the CMP has loaded and had prompted the user. See the google documentation for more details.