Skip to content

Conversation

@kalunkuo
Copy link
Contributor

@kalunkuo kalunkuo commented Oct 22, 2025

Purpose

  • Track IsMLAutocompleteTOUApproved status during initiation
  • Captures the final user preference state to measure opt-out rates
  • Removed analytics tracking from PreferenceSettings.cs to avoid tracking each individual selection event

Declarations

Check these if you believe they are true

Release Notes

Add analytics to track MLTermsOfUse at shut down

Reviewers

@DynamoDS/eidos @DynamoDS/synapse

FYIs

(FILL ME IN, Optional) Names of anyone else you wish to be notified of

@kalunkuo kalunkuo requested review from a team and Copilot October 22, 2025 21:37
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9718

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds analytics tracking for the ML Terms of Use preference state at application shutdown. The change moves the tracking event from the property setter in PreferenceSettings.cs to DynamoModel.ShutDown(), capturing the final user preference state just before the analytics service is shut down. This approach avoids tracking each individual toggle of the preference and instead focuses on the final state to measure opt-out rates.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/DynamoCore/Models/DynamoModel.cs Added analytics tracking call for ML Terms of Use status before analytics service shutdown
src/DynamoCore/Configuration/PreferenceSettings.cs Removed analytics tracking from the IsMLAutocompleteTOUApproved property setter

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@johnpierson johnpierson left a comment

Choose a reason for hiding this comment

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

lgtm!

@johnpierson johnpierson added this to the 4.0 milestone Oct 23, 2025

// Track ML Terms of Use status before shutting down the analytics service.
// This captures the final user preference state to measure opt-out rates.
Analytics.TrackPreference("MLTermsOfUse", "", PreferenceSettings.Instance?.IsMLAutocompleteTOUApproved == true ? 1 : 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Although this would work, but we have one existing pattern that we can follow - report this when initializing Dynamo, and the analytics client.
You can refer to https://github.com/DynamoDS/Dynamo/blob/master/src/DynamoCore/Logging/DynamoAnalyticsClient.cs#L179

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @QilongTang thanks for your comments! I referred to the code you suggested and moved the analytics to when Dynamo and analytics client is initialized. 🙌

@kalunkuo kalunkuo changed the title DYN-9718: Add analytics to track MLTermsOfUse at shut down DYN-9718: Add analytics to track MLTermsOfUse Oct 23, 2025
@QilongTang QilongTang merged commit e86af97 into DynamoDS:master Oct 24, 2025
30 of 31 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 24, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
(cherry picked from commit e86af97)
@github-actions
Copy link

Successfully created backport PR for RC4.0.0_master:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants