Skip to content

LG-6111 - Event tracking for personal key dl#6335

Merged
gsa-manish merged 1 commit intomainfrom
LG-6111-back-event-tracking-personal-key-dl
May 11, 2022
Merged

LG-6111 - Event tracking for personal key dl#6335
gsa-manish merged 1 commit intomainfrom
LG-6111-back-event-tracking-personal-key-dl

Conversation

@gsa-manish
Copy link
Contributor

No description provided.

@gsa-manish gsa-manish requested a review from aduth May 11, 2022 14:47
@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from 7fab59f to 7078284 Compare May 11, 2022 15:04
@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from 7078284 to dd7b95f Compare May 11, 2022 15:13
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to adjust again, but I noticed that in the upcoming reimplementation of this step, this event was implemented in #6257 as ...

Suggested change
trackEvent('IdV: personal key downloaded');
trackEvent('IdV: download personal key');

It would be good to keep these in sync so we don't have to worry about querying for two event names.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries..agreed on keeping them in sync.

Updated.

@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from dd7b95f to b38dcc9 Compare May 11, 2022 16:12
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

LGTM 👍

I notice that the event name was previously "IdV: personal key downloaded" when it was removed in #6162. That being said, the front-end logging will prefix any logged event with "Frontend:", so the event name would be different anyways.

(cc @zachmargolis)

@zachmargolis
Copy link
Contributor

I notice that the event name was previously "IdV: personal key downloaded" when it was removed in #6162. That being said, the front-end logging will prefix any logged event with "Frontend:", so the event name would be different anyways.

Good catch on the Frontend: prefix!

  1. What if we allowlisted the event so we could drop the "Frontend:" prefix?
    EVENT_MAP = {
    'IdV: personal key visited' => :idv_personal_key_visited,
    'IdV: personal key submitted' => :idv_personal_key_submitted,
    'IdV: personal key confirm visited' => :idv_personal_key_confirm_visited,
    'IdV: personal key confirm submitted' => :idv_personal_key_confirm_submitted,
    }.transform_values { |method| AnalyticsEvents.instance_method(method) }.freeze
  2. We have the old method, let's remove the @deprecated since the allowlist would use it?
    # @deprecated
    # A user has downloaded their personal key. This event is no longer emitted.
    # @identity.idp.previous_event_name IdV: download personal key
    def idv_personal_key_downloaded
    track_event('IdV: personal key downloaded')
    end

The documentation tracks the previous name of the event as well, so I think we should use the method

@aduth
Copy link
Contributor

aduth commented May 11, 2022

  1. What if we allowlisted the event so we could drop the "Frontend:" prefix?

I wondered about this, but one thing I worry about is consistency around when and why we want the prefix in some cases and not others for frontend-logged events. If we want to avoid it altogether, I'd almost rather just get rid of the prefix, and force all events to be added to the allowlist.

@zachmargolis
Copy link
Contributor

I wondered about this, but one thing I worry about is consistency around when and why we want the prefix in some cases and not others for frontend-logged events. If we want to avoid it altogether, I'd almost rather just get rid of the prefix, and force all events to be added to the allowlist.

Yes I am a big fan of that! Only issue is that in the ~15 minute deploy window for new events from the client, old servers may reject.

But I think it's worth a shot, we could even tag the Frontend: prefixed as @identity.idp.previous_event_name so that the documentation can capture both new + old

@gsa-manish
Copy link
Contributor Author

I wondered about this, but one thing I worry about is consistency around when and why we want the prefix in some cases and not others for frontend-logged events. If we want to avoid it altogether, I'd almost rather just get rid of the prefix, and force all events to be added to the allowlist.

Yes I am a big fan of that! Only issue is that in the ~15 minute deploy window for new events from the client, old servers may reject.

But I think it's worth a shot, we could even tag the Frontend: prefixed as @identity.idp.previous_event_name so that the documentation can capture both new + old

Thinking we should do this as a separate refactor story?

@zachmargolis
Copy link
Contributor

Thinking we should do this as a separate refactor story?

Yes, migrating the rest of frontend events should totally be a different story (or stories, if we group them in batches of 5)

But for this one, we should definitely add idv_personal_key_downloaded to the allowlist

@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from b38dcc9 to 568276c Compare May 11, 2022 18:08
@gsa-manish
Copy link
Contributor Author

Thinking we should do this as a separate refactor story?

Yes, migrating the rest of frontend events should totally be a different story (or stories, if we group them in batches of 5)

But for this one, we should definitely add idv_personal_key_downloaded to the allowlist

Cool. Added, take a look.

@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from 568276c to 5deb4ee Compare May 11, 2022 18:10
@zachmargolis
Copy link
Contributor

Thanks! Can you remove the @deprecated here?

# @deprecated
# A user has downloaded their personal key. This event is no longer emitted.
# @identity.idp.previous_event_name IdV: download personal key
def idv_personal_key_downloaded
track_event('IdV: personal key downloaded')
end

@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from 5deb4ee to e890e72 Compare May 11, 2022 18:28
@gsa-manish
Copy link
Contributor Author

Ah yes.. done.

@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from e890e72 to 24c4159 Compare May 11, 2022 18:47
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

changelog: Analytics, Event Tracking, Personal Keys Download
@gsa-manish gsa-manish force-pushed the LG-6111-back-event-tracking-personal-key-dl branch from 24c4159 to 9bb4260 Compare May 11, 2022 19:20
@gsa-manish gsa-manish merged commit f25da61 into main May 11, 2022
@gsa-manish gsa-manish deleted the LG-6111-back-event-tracking-personal-key-dl branch May 11, 2022 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants