DAP Implementation
What is DAP?
DAP (Digital Analytics Program) is a web analytics tool that uses Google Analytics 360 to collect and analyze web traffic data. DAP uses Views to categorize and report on federal government agencies website traffic. It is currently only available on public facing agency website pages. For more information, checkout the official DAP page here: DAP
How to implement DAP on your static site
Below is a general guide on how to implement DAP on your static site.
Creating and inserting the script block
Create and insert this script block into the <head>
of the index page of your static site. This will allow the script block to be accessible on every page across your static site.
<script async type="text/javascript" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=defense" id="_fed_an_ua_tag"></script>
Additional Setup
In addition to inserting the script block, you may need to update your content security policy for your static site to allow the javascript to be accessible. Allowing dap.digital.gov
and www.google-analytics.com
into your content security policy should allow the script block to function as intended. Below is an example padawan.toml file with an updated content security policy. See DAP Implementation Guide for more information on how to implement DAP.
Content-Security-Policy = "default-src 'self'; base-uri 'self'; script-src 'self' *.dso.mil dap.digitalgov.gov www.google-analytics.com 'nonce-$cspNonce'; script-src-elem 'self' *.dso.mil dap.digitalgov.gov www.google-analytics.com 'nonce-$cspNonce'; style-src 'self' *.dso.mil 'nonce-$cspNonce'; style-src-elem 'self' *.dso.mil 'nonce-$cspNonce'; img-src 'self' data: mediastream: blob: *.dso.mil 'nonce-$cspNonce'; connect-src 'self' *.dso.mil www.google-analytics.com 'nonce-$cspNonce'; font-src 'self' *.dso.mil 'nonce-$cspNonce'; object-src 'self' *.dso.mil 'nonce-$cspNonce'; media-src 'self' *.dso.mil 'nonce-$cspNonce'; manifest-src 'self' *.dso.mil; form-action 'self' *.dso.mil; frame-src 'none'; frame-ancestors 'none';"