Skip to content

LG-5256: Add logging for help center troubleshooting links#5662

Merged
aduth merged 13 commits intomainfrom
aduth-lg-5256-troubleshooting-links-logging
Dec 6, 2021
Merged

LG-5256: Add logging for help center troubleshooting links#5662
aduth merged 13 commits intomainfrom
aduth-lg-5256-troubleshooting-links-logging

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Dec 2, 2021

Why: To better understand if users are interacting with these links, we want to log interactions with links shown in troubleshooting options.

@zachmargolis
Copy link
Contributor

What if we added a ?source=idp to the URLs and relied on the USA Analytics, so we don't obscure the URL?

@aduth
Copy link
Contributor Author

aduth commented Dec 2, 2021

What if we added a ?source=idp to the URLs and relied on the USA Analytics, so we don't obscure the URL?

Do you mean as an alternative implementation? I see the upside in retaining the original URL, but a concern could be that it fragments where the event details are found and makes it difficult to include in other queries.

Another idea could be to have front-end logging when the link is clicked, though I dunno how well that would work with e.g. right-click + open in new tab, etc.

@zachmargolis
Copy link
Contributor

What if we added a ?source=idp to the URLs and relied on the USA Analytics, so we don't obscure the URL?

Do you mean as an alternative implementation? I see the upside in retaining the original URL, but a concern could be that it fragments where the event details are found and makes it difficult to include in other queries.

Yup! That was my thinking, avoid a redirect by adding info in the URL. Agree that it could fragment analytics since we typically don't search there.

Another idea could be to have front-end logging when the link is clicked, though I dunno how well that would work with e.g. right-click + open in new tab, etc.

My guess is that the redirect-style logging would be more reliable than front-end logging, so I would choose that instead if we don't want to add query params like this

@aduth
Copy link
Contributor Author

aduth commented Dec 2, 2021

Yup! That was my thinking, avoid a redirect by adding info in the URL. Agree that it could fragment analytics since we typically don't search there.

I think we'll want to have these in CloudWatch, especially in comparing them relative to existing "Return to SP" events which are also shown in these troubleshooting options lists of links, and potentially to factor into funnel queries, or to troubleshoot an individual user's experience. But I'll raise it with the team tomorrow to see what they think.

@aduth
Copy link
Contributor Author

aduth commented Dec 2, 2021

Another option which at least helps keep the URL more clearly visible could be to include the full URL of the redirect, URL-encoded as a parameter (with validation, ofc)?

e.g. https://secure.login.gov/redirect?url=https%3A%2F%2Flogin.gov%2Fhelp%2Fverify-your-identity%2Faccepted-state-issued-identification%2F

Not sure it's much better, though.

@zachmargolis
Copy link
Contributor

Another option which at least helps keep the URL more clearly visible could be to include the full URL of the redirect, URL-encoded as a parameter (with validation, ofc)?

e.g. https://secure.login.gov/redirect?url=https%3A%2F%2Flogin.gov%2Fhelp%2Fverify-your-identity%2Faccepted-state-issued-identification%2F

Not sure it's much better, though.

Yeah I don't think that's necessarily better, even though you mentioned it would be validated, it looks like an open redirect vulnerability and we probably don't want that attention

@aduth
Copy link
Contributor Author

aduth commented Dec 2, 2021

it looks like an open redirect vulnerability and we probably don't want that attention

Hah, I hadn't considered that, but very good point to avoid some future headaches 😅

aduth added 9 commits December 3, 2021 09:05
**Why**: To better understand if users are interacting with these links, we want to log interactions with links shown in troubleshooting options.
It's part of the point of having an abstract class
**Why**: To better communicate intent of class as being abstract
Leftover from changing to nested hash to hash of array values
**Why**: Since it's now an extending controller of the base RedirectController
**Why**: To avoid needing to pass multiple strings into context for individual help articles, and to be able to easily inject location parameters for logging details.
@aduth aduth force-pushed the aduth-lg-5256-troubleshooting-links-logging branch from 55bccf6 to 6e65e46 Compare December 3, 2021 15:03
@aduth aduth marked this pull request as ready for review December 3, 2021 15:36
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

*/
function HelpCenterContextProvider({ value, children }) {
/** @type {GetHelpCenterURL} */
const getHelpCenterURL = (params) => addSearchParams(value.helpCenterRedirectURL, params);
Copy link
Contributor

Choose a reason for hiding this comment

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

to me this seems more like a build method than a get method?

Copy link
Contributor Author

@aduth aduth Dec 3, 2021

Choose a reason for hiding this comment

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

to me this seems more like a build method than a get method?

Hm, could you explain more? Is the idea that a get-prefixed method would only return a value directly, not derive something? I guess I've not made much a distinction on this previously, or at least would be happy to just offer up the value directly if that's what a "get" would imply.

I don't feel too strongly, but more worry that we haven't made much of a distinction in the past, so an argument could be made to the point of "consistency for consistency's sake" 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

in my head, "get" is like "retrieve" like a load from a database or a hash or something

whereas in this case, we're not retrieving anything, we're building a new string based on some immediate values

But this is just personal style, like you said, we don't have a codebase style so I really don't feel that strongly about enforcing it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I think I'll plan to keep it as-is for now, though perhaps separately we can think about / document naming conventions around methods.

To maintain redirects during deploy window

See: #5662 (comment)
@aduth aduth merged commit 6f167b9 into main Dec 6, 2021
@aduth aduth deleted the aduth-lg-5256-troubleshooting-links-logging branch December 6, 2021 13:29
aduth added a commit that referenced this pull request Dec 7, 2021
**Why**: Because they exist only as a stopgap for mid-deploy routing, they are no longer needed as of RC169.

Previously: #5662
aduth added a commit that referenced this pull request Dec 10, 2021
**Why**: Because they exist only as a stopgap for mid-deploy routing, they are no longer needed as of RC169.

Previously: #5662
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.

2 participants