department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
282 stars 203 forks source link

Analytics Implementation or QA Support for AFS-Education team - GI Bill Comparison Tool Redesign #27074

Closed amyknox closed 2 years ago

amyknox commented 3 years ago

Google Analytics Implementation or QA Request

All other teams: Implementation will usually be completed in 2 sprints

  • Sprint 1: Discovery and FE Implementation
  • Sprint 2: Tagging Implementation and QA

Description

Implementation

No PII is passed in the URL or title

We want to track everything that generally would be tracked (no opt-out of standard component tracking)

Please leave the following blank

Acceptance Criteria

Definition of Done

bsmartin-ep commented 3 years ago

Apologies for the delay @amyknox. I'll have your mega analytics document prepared shortly, but had a few clarifying questions.

  1. In general, are we making a clean break from the old GIBCT analytics? Most (if not all) of the old tagging seems to be represented in your request, but wanted to make sure we only want to track what is in your document. If you need me to outline what might be missing, let me know.

    One thing I'm doing is cutting GIBCT over to the standard site search event, which will let us add the data to our Search KPI dashboard in Domo.

  2. Would this component be considered a variation of an alert box? Or is it a re-styled accordion / additional info?

image

  1. "Cautionary warnings" are a characteristic of the school (or branch), correct? And not reliant on something the user did? If it's the former, I think we just add an extra custom dimension - like schoolHasWarnings = true - to the pageview.

For schools with cautionary warnings, do users visit profiles?

  1. Can you point me to these two interactions in the sandbox?

User exits to About this tool page

User downloads data on all schools (Excel download)

amyknox commented 3 years ago

In general, are we making a clean break from the old GIBCT analytics?

Yes - a clean break but we don't want to lose the old analytics so we can compare before & after.

Most (if not all) of the old tagging seems to be represented in your request, but wanted to make sure we only want to track what is in your document. If you need me to outline what might be missing, let me know.

Thanks for the offer to identify what's missing in this new request. I would really appreciate your insights on that.

One thing I'm doing is cutting GIBCT over to the standard site search event, which will let us add the data to our Search KPI dashboard in Domo.

I'm ok with that as long as we can still get to the GIBCT search results on their own.

Would this component be considered a variation of an alert box? Or is it a re-styled accordion / additional info?

Yes - the "Cautionary warnings" are an alert box - with bonus interaction.

"Cautionary warnings" are a characteristic of the school (or branch), correct? And not reliant on something the user did? If it's the former, I think we just add an extra custom dimension - like schoolHasWarnings = true - to the pageview.

Yes, Cautionary warnings show up based on data associated with the institution's facility number. Their appearance has nothing to do with UI. However, we are interested to see if users click the carat to open a cautionary warning and read the full warning content.

For schools with cautionary warnings, do users visit profiles?

Users can visit the school profiles but one goal of these cautionary warning is to discourage those visits. Since the cautionary warnings come & go on the profiles, it's difficult to track which specific profiles have them but perhaps we can aggregate open/close/visits. ??

Can you point me to these two interactions in the sandbox? User exits to About this tool page> User downloads data on all schools (Excel download)

For "About this tool" page... users can get there via many of the "Learn more" modals image image

And for "About this tool" and "Download all data", there will be links at the bottom of the search, compare and profile pages similar to what's on production now. These are missing from the sandbox right now but you can see them in action here.

bsmartin-ep commented 3 years ago

@amyknox -

Yes - a clean break but we don't want to lose the old analytics so we can compare before & after.

Definitely! Most of the events will be slightly restructured, so getting all historical data in one GA report might be tough. But the events will be in there.

Thanks for the offer to identify what's missing in this new request. I would really appreciate your insights on that.

I double checked everything and I think everything in the current GTM tagging is represented in your request. We would like you to transition from GIBCT specific tags to our more generic tagging, but all your form interactions, modal clicks etc are in the new doc.

I'm ok with that as long as we can still get to the GIBCT search results on their own.

Absolutely! One of the parameters is search-selection which identifies which search it is. You will have that + the page path of the event.

Yes - the "Cautionary warnings" are an alert box - with bonus interaction.

OK - we have analytics baked into the alert box component, but only the link clicks in the content. We can map out anav- event for this.

Users can visit the school profiles but one goal of these cautionary warning is to discourage those visits. Since the cautionary warnings come & go on the profiles, it's difficult to track which specific profiles have them but perhaps we can aggregate open/close/visits. ??

I'll get some sort of identifying dimension into this - like the heading of the school block - so we can map this process. It may be a job for BigQuery to be honest.

bsmartin-ep commented 3 years ago

Components or manual?

Depending on how you approach this, we may only need to define a few of these interactions for you.

Some of this is already tracked, but using old and GIBCT-specific events. This is probably our best opportunity to fix this particular tech debt. It will make the transition to GA4 easier plus get your interactions onto our KPI Content dashboard.

Ideally your developers would use the React or web components that have analytics baked-in for form interactions, accordions, and modals. Otherwise, we would need to manually push in our updated event taxonomy for these events. We also now have generic link_click and button_click events to use for those interactions.


Accordions

This is currently tracking in your demos, but is using the old event taxonomy (nav-accordion-expand|collapse vs int-accordion-expand|collapse). Ideally, this is replaced with the va-accordion web component, which has analytics built in. Otherwise, you should update your manual dataLayer push to the new event.

Radio buttons / selects / checkboxes

Ideally, these would be updated to use the new web components (va-select, va-checkbox, RadioButtons - soon to be a web component as well). For these form components, if you add an enableAnalytics parameter, they will log events in GA.

Otherwise, you will need to manually push an event for these interactions - which can be found here. All existing gibct-form-change events should be updated.

Modals

If these can be updated to use the component library's Modal. Otherwise, the gibct-modal-link-click event should be updated to use the new modal event.

Link Clicks

Out of the box, you can look at a pageview's URL + Previous Page Path and back your way into a lot of link clicks. But if manual and deliberate tracking of link clicks is desirable - or necessary if a link doesn't change the page URL - we recommend our link_click event. Documentation incoming for this.

Button Clicks

We have a button_click event that we can use for this. Most of the parameters are straightforward, but we'll have to map out the button types for you. Documentation incoming for this.

amyknox commented 3 years ago

@bsmartin-ep - thanks for all the intel. Is this ready for us now or is there more mega doc in the works?

bsmartin-ep commented 3 years ago

Sorry @amyknox - I missed your response. If your team can switch to the UI components for the majority of form interactions, I think you'll just need the events for:

...which I have ready to go.

amyknox commented 3 years ago

@bsmartin-ep - great - I can pass this info on to our BA. Where do we look to access the events for search, link clicks & button clicks?

bsmartin-ep commented 3 years ago

@amyknox -

Link Clicks

{
    event: 'link_click',
    'link-text': 'My Link Text',
    'link-type': null, // All your links are just regular links, correct?
    'link-url': '/health_care/',
}

Button Clicks

{
    event: 'button_click',
    'button-text': 'My Button Text',
    'button-type': '(CTA - Primary|CTA - Secondary|CTA - Default|Back to Top)',
}

Site Searches

Documentation: https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/platform/analytics/google-analytics/tracking-search.md

On Search

{
  event: 'view_search_results',
  'search-page-path': '/gi-bill-comparison-tool-sandbox/?search=location',
  'search-query': 'York',
  'search-results-total-count': 0,
  'search-results-total-pages': 0,
  'search-selection': 'GIBCT - Name',
  // 'search-selection': 'GIBCT - Location',
  'search-typeahead-enabled': false,
  'sitewide-search-app-used': false, 
  'type-ahead-option-keyword-selected': undefined,
  'type-ahead-option-position': undefined,
  'type-ahead-options-list': undefined,
  'type-ahead-options-count': undefined,
}

On Search Results Click

{
    'event': 'onsite-search-results-click',
    'search-result-type': 'title' //dynamically populate with 'pdf', if pd for 'cta' if a cta click
    'search-filters-list': undefined,
    'search-results-top-recommendation': true|false //populate boolean according to if result clicked was a top recommendation
    'search-selection': 'GIBCT - Name',
    // 'search-selection': 'GIBCT - Location',
    'search-result-chosen-page-url': 'https://www.va.gov/benefits' //dynamically populate accoding to the url href
    'search-result-chosen-title': 'Veterans Benefits Administration Home' //dynamically populate with the top level title
    'search-query': 'health assessment',
    'search-results-total-count': 999,
    'search-results-total-pages': 0,
    'search-result-position': 4
    'search-result-page': 1
}
dneel-bah commented 3 years ago

@bsmartin-ep After discussing with the team, we're going to have to proceed with the manual route. I see that we have link, button and search guidance above. Is similar guidance available for Accordions, Radio buttons / selects / checkboxes, and modals?

bsmartin-ep commented 3 years ago

@amyknox - our Confluence docs are still a WIP but all form tracking events can be found here:

https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/teams/vsp/teams/insights-analytics/tracking-design-system-components.md

bsmartin-ep commented 3 years ago

Apologies @dneel-bah - I meant to tag you...

Our Confluence docs are still a WIP but all form tracking events can be found here:

https://github.com/department-of-veterans-affairs/va.gov-team/blob/master/teams/vsp/teams/insights-analytics/tracking-design-system-components.md

joanneesteban commented 3 years ago

Platform Analytics will be moving this ticket to blocked until another VFS team takes this up.

bsmartin-ep commented 2 years ago

cc @ERRonat0609

ERRonat0609 commented 2 years ago

@bsmartin-ep - I have updated the ticket with our team information. Let me know if there is anything else you need from us. Just to clarify, this is work that the analytics team is doing, correct? Is there anything you need from us other than what was provided by BAH in the original ticket? thanks!

ERRonat0609 commented 2 years ago

@bsmartin-ep The above issues associated with this issue were closed as duplicates of the following issues that are complete now: https://github.com/department-of-veterans-affairs/va.gov-team/issues/32625 https://github.com/department-of-veterans-affairs/va.gov-team/issues/32626 https://github.com/department-of-veterans-affairs/va.gov-team/issues/32627 https://github.com/department-of-veterans-affairs/va.gov-team/issues/32629 https://github.com/department-of-veterans-affairs/va.gov-team/issues/32631

bsmartin-ep commented 2 years ago

QA - WIP

GTM container: https://tagmanager.google.com/#/container/accounts/144676348/containers/2214120/workspaces/1000578

Interaction Tag
Tab Click image
Search By Location image
Search by Name image
Accordion Expand image
Accordion Collapse image
Checkbox check image
Dropdown change image
View Profile (no warnings) image
View Profile (with warnings) image
Compare Checkbox image