Skip to content

Manage collection of usage data#207

Merged
rossjones merged 8 commits into
mainfrom
usage-collection
May 21, 2025
Merged

Manage collection of usage data#207
rossjones merged 8 commits into
mainfrom
usage-collection

Conversation

@rossjones
Copy link
Copy Markdown
Contributor

@rossjones rossjones commented Apr 30, 2025

Adds a new option to the configuration page, to allow users to opt-in to usage data collection, which looks like:

Plugin_Configuration_-_Upload_monthly_pension_return

Not 100% sure of the wording, but the functionality works as advertised, adding a new option to the usage-data-config.json file.

Note this does not actually collect any data at present, but simply prints the event name out to the console.

When a user of the prototype kit creates a new prototype, they are asked
if they would like to allow usage data to be shared with the authors.
This change uses that permission to measure usage unless the user has
explicitly disabled the plugin from collecting metrics, or changes the
prototype kit permission to false.
This commit adds an explanation to the console when running the
prototype kit, about the data importer's anonymous usage data.

Currently it is set to the following when the user has agreed to allow
usage data, and has not explicitly disabled it.

```
[WebServer] Watching dependency @register-dynamics/importer as it's a symbolic link.
[WebServer]
[WebServer] You are currently sending anonymous usage data to the prototype kit team.
[WebServer] In addition to this, anonymous usage data is also being sent to the authors
[WebServer] of the Data Upload Design Kit.
[WebServer] Should you wish to disable this you can do so by adding
[WebServer]
[WebServer]     disableImporterUsageData: true
[WebServer]
[WebServer] to the usage-data-config.json file in the prototype's directory.
```

We initially discussed doing this during the postinstall step, but this
results in it being output too early (before the user has accepted on
the first npm run dev) and obscured by more following content.
@rossjones rossjones changed the title Add support for usage measurement where enabled Manage collection of usage data Apr 30, 2025
@rossjones rossjones marked this pull request as ready for review April 30, 2025 10:51
@rossjones rossjones requested a review from simonwo April 30, 2025 10:52
Comment thread lib/importer/src/usage.js Outdated
return JSON.parse(data)
}

const updateDDUKPermission = (ddukPermission) => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct acronym would be DUDK

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 67e7459

Comment thread lib/importer/views/plugin_config.html Outdated

<p class="govuk-body">
Allow Register Dynamics to collect usage data on your use of the Data Upload Design Kit.
When enabled, the following events will be reported with no further data:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we include that we will collect "an anonymous ID specific to this prototype"? As it would be good to collect the client ID.

Copy link
Copy Markdown
Contributor Author

@rossjones rossjones May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c259dd4

Comment thread lib/importer/views/plugin_config.html Outdated
<h2 class="govuk-heading-l"></h2>

<div class="govuk-form-group">
<fieldset class="govuk-fieldset" aria-describedby="waste-hint">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aria attribute should be the id of an element which describes this one. If we don't have one then we can just remove the attribute?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops copy and paste fail on my part

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to 97ef5d9

</label>
</div>
</div>
</fieldset>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add an alternative call to action, eg "If you don't want usage data to be collected, please consider dropping a note to us on Github to let us know how you're using the Kit. Thanks!"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added to 97ef5d9

@rossjones rossjones merged commit 656a42a into main May 21, 2025
5 checks passed
@rossjones rossjones deleted the usage-collection branch May 21, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants