-
Notifications
You must be signed in to change notification settings - Fork 56
DAP Code Capabilities Summary
The DAP program offers the DAP Code as a means for agencies to participate in DAP while also providing more advanced measurement capabilities for Google Analytics, in an easy-to-install format. The below section lists out advanced features of the DAP Code and links to their reference section for details on how to install it.
This value is required to be implemented for every agency. This enables the DAP team to understand differences in web trends across participating agencies and enables the DAP team to create a filtered view for the agency to use and analyze.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
agency | String | unspecified:domain.com | Agency custom dimension value | Agency custom dimension appears as "unspecified:domain.com" in the reporting interface |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS"></script
>
This value is not required but is recommended to implement when applicable. This enables the DAP team to understand differences in web trends across participating sub-agencies.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
subagency | String | unspecified:domain.com domain.com | Sub-agency custom dimension value | Sub Agency custom dimension appears as "unspecified:domain.com – domain.com" in the reporting interface |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&subagency=FEMA"></script>
This value is not required but is recommended to implement when applicable. This enables the DAP team to understand differences in web trends across different website topics, such as health or travel.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
sitetopic | String | unspecified:domain.com | Site topic custom dimension value | Site Topic custom dimension appears as "unspecified:domain.com" in the reporting interface |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&sitetopic=health"></script>
This value is not required but is recommended to implement when applicable. This enables the DAP team to understand differences in web trends across different website platforms, such as Cloud.gov Pages.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
siteplatform | String | unspecified:domain.com | Site platform custom dimension value | Site platform custom dimension appears as "unspecified:domain.com" in the reporting interface |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&siteplatform=SitesUSA"></script>
If your website utilizes a site search engine, you may be able to track the queries your users type into their site searches in your DAP agency reporting. In the examples shown below, assume that the user did a search for “money” and the site search results page had a URL that looks like this: www.website.com/search?term=money
In that case, “term” would be the value you would set for the sp parameter in your DAP Code tracking. Note that by default, these search parameters are automatically tracked: q, query, nasaInclude, k, querytext, keys, qt, search_input, search, globalSearch, goog, s, gsearch, search_keywords, SearchableText, sp_q, qs, psnetsearch, locate, lookup, search_api_views_fulltext, keywords, request, _3_keywords, searchString
Note: If needed, you can set the sp parameter to multiple values by separating them with a comma. Like this: sp=term,keyword,kw_
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
sp | Comma separated string | By default, these search parameters are automatically tracked:q, query, nasaInclude, k, querytext, keys, qt, search_input, search, globalSearch, goog, s, gsearch, search_keywords, SearchableText, sp_q, qs, psnetsearch, locate, lookup, search_api_views_fulltext, keywords, request, _3_keywords, searchString | Additional search parameter | By default, these search parameters are automatically tracked: q, query, nasaInclude, k, querytext, keys, qt, search_input, search, globalSearch, goog, s, gsearch, search_keywords, SearchableText, sp_q, qs, psnetsearch, locate, lookup, search_api_views_fulltext, keywords, request, _3_keywords, searchString |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&sp=term"></script>
By default, the DAP Code automatically tracks downloads for these file types (when users click on a link that contains one of these document extensions in the target URL):
However, if you need another file type to be measured (such as psd, for example), you can add it using the exts parameter.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
exts | Comma | Additional download | Only the pre-defined file extensions will be included as downloads. Note that if autotracking is disabled using the autotracker parameter, no file downloads will be recorded. |
Note: You can add multiple additional file types by setting the exts parameter to multiple values separated by a comma string, such as: exts=psd,png,json
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&exts=psd"></script>
By default, the DAP Code does not automatically track YouTube video interactions. You can enable this by setting the default value of the yt parameter to “true”. Possible YouTube interactions include play, pause, and finish, as well as tracking the % of the video completed on configured milestones defaulted to every 25% of the video duration.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
yt | boolean | false | Enable/Disable YouTube Tracker | YouTube videos will not be tracked. |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&yt=false"></script>
By default, the DAP Code does automatically track HTML5 Media interactions. You can disable this by setting the default value of the htmlvideo parameter to “false”. Possible HTML5 Media interactions include play, pause, and finish, as well as tracking the % of the video/audio completed on configured milestones defaulted to every 25% of the video/audio duration.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
htmlvideo | boolean | true | Enable/Disable HTML5 Video/AudioTracker | HTML5 media will be tracked. |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&htmlvideo=false"></script>
If YouTube tracking is enabled, By default, the DAP Code will track YouTube video progress every 25% of the video duration. You can modify this setting to be every 10% or 20% instead. By setting the "ytm" parameter to the desired progression milestone from the acceptable va
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
ytm | Number from preselected values 10,20, or 25 | 25 | Controls the frequency of video/media progress event firing | YouTube videos / HTML5 Media progress event will be tracked based on selected milestone |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&ytm=20"></script>
If an agency wishes to use the DAP code to implement an additional GA4 property (such as one that the agency owns and operates), they may do so by using the pga4 parameter. The pga4 parameter would be set to the GA4 measurement ID for their GA4 property, such as pga4=G-111111
Note: The DAP code is preventing the use of the main measurement id as parallel measurement id to avoid any potential duplication due to improper implementation.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
pga4 | Measurement ID | Parallel GA4 Trackers | No additional properties are tracked. |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&pga4=G-111111"></script>
When using a Parallel Google Analytics Property via the pga4 parameter and set parallelcd parameter to true, the following event parameters are used by default:
- agency
- sub_agency
- version
- site_topic
- site_platform
- script_source
- protocol
- Interaction_type
- event_name_dimension (used to store the event name as an event parameter to facilitate custom reporting)
- using_parallel_tracker
By default, the DAP Code automatically tracks downloads for these file types (when users click on a link that contains one of these document extensions in the target URL):
Outbound link clicks are also tracked. Outbound links are determined by comparing the link’s target URL with the current website domain and its sub-domains. Additionally, this feature measures email link clicks. These are determined as links that contain “mailto:” in the target URL. With all of these different link events, both mouse clicks and Enter key keystrokes are tracked. An “Interaction Type” custom dimension is included with these hits so that the method used to open the link can be analyzed. If an agency would like to disable these features, they can do so by setting the autotracker parameter to false.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
autotracker | boolean | true | Enable/Disable AutoTracker | Downloads and outbound links are automatically tracked. |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&autotracker=false"></script>
By default, Google Analytics cookies for the user expire after 24 months (2 years). This means that if a user does not return to the website for 2 full years, they will be considered a new user when they return. If an agency would like to shorten this cookie window, so that a user is considered “new” again after 1 year’s absence from the website (for example), they can set the cto parameter to the new desired expiration in months. For example, cto=12 would set the cookie expiration date to 12 months from the date of the most recent hit.
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
cto | Integer (of months) | 24 | Ga cookie expiration in months | GA cookie expires from user's system after 2 of not being updated.Note: For Chrome it shouldn’t be more than 400 days ~ 13 months. |
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&cto=12"></script>
By default, Google Analytics cookies have the following cookie settings:
- SameSite= Strict: Means that the browser sends the cookie only for same-site requests, that is, requests originating from the same site that set the cookie. If a request originates from a different domain or scheme (even with the same domain), no cookies with the SameSite=Strict attribute are sent.
- Secure: Indicates that the cookie is sent to the server only when a request is made with the https: scheme (except on localhost), and therefore, is more resistant to man-in-the-middle attacks.
By default, the DAP code will report the default browser page's URL to GA. If an agency wishes to use the DAP code to track a custom page pathname, they may do so using the custurl parameter. The custurl parameter would be set to true such as custurl=true AND set a variable containing the desired custom page path as shown below
**Note: **
- Please don't set custom_dap_data.url to the full URL, page path + search is expected for the DAP to work properly.
- Don't change the variable the name of the variables(custom_dap_data, URL, title)
- The custom_dap_data must be added before the DAP code script tag
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
custurl | Boolean | Custom Page Path | No custom path is used |
<script type="text/javascript">
var custom_dap_data = {url : '/customURL?q=text', title : "custom --- title"};
</script>
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&custurl=true"></script>
By default, the DAP code will report the default browser page's title to GA. If an agency wishes to use the DAP code to track a custom page title, they may do so by using the custitle parameter. The custitle parameter would be set to true such as custitle=true AND set a variable containing the desired custom page title as shown below
**Note: **
- Don't change the variable the name of the variables(custom_dap_data, URL, title)
- The custom_dap_data must be added before the DAP code script tag
Query String Parameter | Data Type | Default Value | Description | Default Behavior |
---|---|---|---|---|
custitle | Boolean | Custom Page Title | No custom title is used |
<script type="text/javascript">
var custom_dap_data = {url : '/customURL?q=text', title : "custom --- title"};
</script>
<script async type="text/javascript" id="_fed_an_ua_tag" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&custitle=true"></script>
Whitelisting allows tracking of particular query-string parameters, by cross-referencing them with both the "default" set (containing Google's predefined and search terms query strings) and specific agency Query String such as "gsa", "dhs", "doc", "hhs", "hud", "nasa", "nsf", "va", "dod", "opm"
If there is a new requirement to include additional custom query-string parameters, it is necessary to reach out to the GSA DAP team. Alternatively, agencies have the option to transmit these parameters using the query string SP key.
Agency | Query String Parameter |
---|---|
default | utm_id,utm_source,utm_medium,utm_campaign,utm_term,utm_content,_gl,gclid,dclid,gclsrc, affiliate, dap-dev-env, v, q, query,nasaInclude,k,querytext, keys, qt,search_input, search,globalSearch, goog,s,gsearch,search_keywords, SearchableText,sp_q, qs,psnetsearch,v locate, lookup,search_api_views_fulltext,k eywords,r equest,_3_keywords, searchString |
gsa | challenge, state |
dhs | appreceiptnum |
doc | station,meas, start,atlc,epac,cpac, basin,fdays, cone,tswind120,gm_track,50wind120,hwind120,mltoa34, swath, radii,wsurge,key_messages, inundation,rainqpf,ero, gage,wfo,spanish_key_messages,key_messag es, sid,lan, office, pil |
hhs | s_cid,selectedFacets |
hud | PostID |
nasa | feature, ProductID,selectedFacets |
nps | gid,mapid, site, webcam, id |
nsf | meas, start,atlc,epac,cpac, basin,fdays, cone,tswind120,gm_track,50wind120,hwind120,mltoa34, swath, radii,wsurge,key_messages, inundation,rainqpf,ero, gage,wfo,spanish_key_messages, key_messages, sid |
va | id |
dod | p |
opm | l, soc, jt, j, rmi, smin, hp, g, d, a |
As of version 4.0 of the DAP code, source mapping is supported. This allows the original file to be viewed and debugged within developer tools. There is nothing that agencies need to do to enable this.