Update module to follow DAP Guidelines

Created on 12 August 2024, about 2 months ago

Problem/Motivation

script tag does not follow DAP Guidelines at https://github.com/digital-analytics-program/gov-wide-code/wiki/DAP-Quic...

Script tag is missing async type="text/javascript" attributes and is not placed in the <head>

Per DAP Support team "We would prefer that developers follow what we instructed on our GitHub page. The placement of the script tag in the body and not having the async attribute could cause loading issues with the script when the page loads. It also allows us to debug easier if we have consistency throughout. The type attribute might not be as important but it is still good to have as well."

Steps to reproduce

Install and use module

Proposed resolution

Change script from
<script src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=AGENCY" id="_fed_an_ua_tag"></script>
to
<script async type="text/javascript" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=AGENCY" id="_fed_an_ua_tag"></script>

and move from bottom of page in </body> and place in <head></head>

Remaining tasks

NA

User interface changes

NA

API changes

NA

Data model changes

NA

πŸ› Bug report
Status

Active

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States eric@erubino.net Washington DC

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024