Skip to content

Instantly share code, notes, and snippets.

@sahava
Created February 20, 2021 21:23
Show Gist options
  • Save sahava/b8095be749550c72d4c9debea83b4096 to your computer and use it in GitHub Desktop.
Save sahava/b8095be749550c72d4c9debea83b4096 to your computer and use it in GitHub Desktop.
Sample Server container policy file
gtag('policy', 'all', function(container, policy, data) {
switch (policy) {
// Only allow _ga cookie to be set.
case 'set_cookies':
return data.name === '_ga';
// All other permission requests are allowed.
case 'access_response':
case 'access_template_storage':
case 'get_cookies':
case 'logging':
case 'use_message':
case 'read_container_data':
case 'read_event_data':
case 'read_event_metadata':
case 'read_request':
case 'return_response':
case 'run_container':
case 'send_http':
default:
return true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment