Update to DAP JS v8

Created on 17 June 2024, 10 months ago
Updated 9 July 2024, 9 months ago

Problem/Motivation

The following email was sent out by DAP on Sunday, June 16:

On July 1, 2024, Google will sunset its Universal Analytics (UA) 360 Premium platform, ceasing all of the UA data collection and reporting. The UA reporting portal and interface, historical data, reports and dashboards will no longer exist post July 1, 2024, replaced by Google Analytics 4 (GA4) - the only Google Analytics platform.

NEXT CODE RELEASE: On June 24, 2024, DAP will release a new major code version 8.0, focused primarily on the removal of UA code. It will also contain a few other updates, including lowercase enforcement for hostnames, new custom event naming taxonomy in addition to the dap_event, updates to redaction code to allow additional matching cases, and backward compatibility for the GAS function for new custom tracking code in GA4.

CALL TO ACTION:

  • For agencies using DAP code from the centrally-hosted location without “pua” parameter for parallel tracking for their own GA account(s): NO ACTION REQUIRED
  • For agencies self-hosting the DAP code: agencies must download the DAP v.8.0 code from the DAP Github repository on June 25, 2024 or shortly after and install it on their servers
  • For agencies using DAP code with parallel-tracking or “pua” (stands for Parallel Universal Analytics): agencies should replace their “pua” parameter and UA account number with a “pga4” parameter and your GA4 account number as soon as possible. See the example below:

Replace the “pua” parameter and account information (example only)
<script async type="text/javascript" id="_fed_an_ua_tag" src=https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=DHS&pua=UA-000000-0></script>

with “pga4” parameter and account information (example only)
<script async type="text/javascript" id="_fed_an_ua_tag" src=https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=DHS&pga4=G-111111></script>

Proposed resolution

The local versions of DAP JS included with the module will need to be updated. I suggest that the pua config property be deprecated, but not removed. Remove it from the properties in usfedgov_google_analytics_default_settings() so it isn't included in the JS query string. But leave it disabled in the config form with a new description saying at it's in there "for reference and will be removed in version 3.0." This may help anyone who for whatever reason needs to know what the UA ID of the site was.

Deprecating the pua property may allow you to release version 2.2.0 of the module. I'm not sure if there are other breaking changes in DAP v8 that would warrant releasing version 3.0.0 of the module. But if you delete the pua property outright, then you'll definitely have to release version 3.0.0 because people will be facing a potential data loss scenario.

Remaining tasks

  • Decide on a path forward
  • Make the changes
  • Test

Data model changes

Deprecate/delete the pua property. Add the pga4 config property and output it to the JS query parameters.

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States dcam

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

Merge Requests

Comments & Activities

  • Issue created by @dcam
  • 🇺🇸United States dcam

    I created a draft MR that disables the pua setting and adds the pga4 setting. I had to fix a couple of bugs along the way. The pua setting was being cast into an int by the form. This appears to have been copied and pasted from other settings. Also, the module's settings schema type needed to be changed to a config_object. Saving the config form resulted in an error and failure to save unless this change was made.

    I need to look up the deprecation procedures for config properties and see if there's more to do for that. But that can wait until after lunch.

    I think we should wait until June 25 to copy the DAP JS into the local files.

  • Pipeline finished with Success
    10 months ago
    Total: 200s
    #201148
  • Pipeline finished with Success
    10 months ago
    Total: 146s
    #201155
  • 🇺🇸United States jrglasgow Idaho

    @dcam,
    This looks good, I assume that once the JS is released next week you will update your branch to include it. When that is done go ahead and merge in your changes (I have made you a maintainer) and then create a new release.

  • 🇺🇸United States dcam

    @jrglasgow Yeah, I'll take care of it. Thank you for entrusting me with maintainer status.

  • 🇺🇸United States dcam

    The new JS was released last night. I'm working on it now.

  • 🇺🇸United States dcam
  • Pipeline finished with Skipped
    10 months ago
    #207875
    • dcam committed 10657c81 on 2.x
      Issue #3455075 by dcam, jrglasgow: Update to DAP JS v8
      
  • Status changed to Fixed 10 months ago
  • 🇺🇸United States dcam
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024