Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grab browser information for feedback box submitted issues #2985

Open
1 of 3 tasks
Tracked by #159
JonellaCulmer opened this issue Jun 20, 2019 · 6 comments
Open
1 of 3 tasks
Tracked by #159

Grab browser information for feedback box submitted issues #2985

JonellaCulmer opened this issue Jun 20, 2019 · 6 comments

Comments

@JonellaCulmer
Copy link
Contributor

JonellaCulmer commented Jun 20, 2019

What we're after: Consider if we can capture additional helpful information, such as browser/browser version, or other data, for issues submitted via the feedback box.

I hesitate to include additional form questions to the form from fear that users will see it as a burden to submitting an issue, so wondering if we grab this information similar to how we grab the URL.

Related issue:

Completion criteria:

  • Investigate what our options are for including more information for feedback box submitted issues.
    - [ ] Open follow-up ticket for implementation, as appropriate
  • Verify if we have access to the CloudFront dashboard for making changes that would allow us to return user-agent info in headers
  • Put hidden fields in the feedback box that use JS to return user-agent and possible more info like OS, device(mobile or desktop) etc.
@lbeaufort lbeaufort added this to the Sprint 9.4 milestone Jul 1, 2019
@lbeaufort
Copy link
Member

lbeaufort commented Jul 1, 2019

It looks like the HTTP_USER_AGENT header should be the browser but is being overwritten by the CloudFront, which is why it always comes back as "Amazon CloudFront"

See https://forums.aws.amazon.com/thread.jspa?messageID=420294#420294
It looks like we might be able to get the header another way: https://aws.amazon.com/blogs/aws/enhanced-cloudfront-customization/

Any headers added by CloudFront will be prefixed with CloudFront-. You can use the User Agent header to identify and discriminate between desktop and mobile devices, and to provide content that is suitable for and appropriate to each one.

@johnnyporkchops
Copy link
Contributor

johnnyporkchops commented Jul 9, 2019

Using CF headers to get the user agent seems like it might be a bit involved and also require at least some maintenance in AWS dashboard.

  • Looking into wether we can use Google Tag Manager User Agent var to get the browser
  • Or just straight JS user agent sniffing--a decidedly inexact science.

@johnnyporkchops
Copy link
Contributor

Headers solution: First we need to verify if we have access to the CloudFront dashboard for making changes that would allow us to return user-agent info in headers?
Possible JS solution: We can put hidden fields in the feedback box that use JS to return user-agent and possible more info like OS, device(mobile or desktop) etc. User-agent sniffing is an inexact practice as the strings returned can often change or be sent in differing formats, but in this case, it only has to be human-readable for us to decipher what user-agent (browser) the submitter was using.

@dorothyyeager dorothyyeager changed the title Research: Grab browser information for feedback box submitted issues Grab browser information for feedback box submitted issues Jul 15, 2019
@dorothyyeager dorothyyeager modified the milestones: Sprint 9.4, Sprint 9.5 Jul 15, 2019
@patphongs
Copy link
Member

patphongs commented Jul 16, 2019

We need the feedback box working on stage.fec.gov and dev.fec.gov, currently it is not working. Those domains utilize the CDN service. After this is fixed we can try implementing one of the solutions above from @johnnyporkchops

Error when submitting to stage.fec.gov feedback box
Screen Shot 2019-07-16 at 10.17.19 AM.png

@dorothyyeager
Copy link
Contributor

dorothyyeager commented Jul 25, 2019

I've put in an issue to fix broken feedback box in stage.fec.gov and dev.fec.gov. As Pat notes, that problem is blocking this issue from being completed.

@rfultz
Copy link
Contributor

rfultz commented Sep 12, 2019

At least in Chrome, here are some variables easily available to us, along with some sample values.

window.navigator.connection.downlink: 5.8
window.navigator.language: "en-US"
window.navigator.maxTouchPoints: 0
window.navigator.platform: "MacIntel"
window.navigator.userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome..."

window.outerHeight: 1023
window.outerWidth: 1694
window.pageXOffset: 0
window.pageYOffset: 0
window.screen.colorDepth: 24
window.screen.height: 1080
window.screen.width: 1920
window.scrollX: 0
window.scrollY: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

6 participants