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

STEM: Add additional GA tracking to 10203 #12733

Closed dneel-bah closed 4 years ago

dneel-bah commented 4 years ago

As a developer, I need to add additional Google Analytics tracking to the STEM 10203 so that adjustments can be made to the form based on user behavior.

Assumptions:

  1. This work Originally posted by @jonwehausen in https://github.com/department-of-veterans-affairs/va.gov-team/issues/10780#issuecomment-678442138
  2. This work does not need to be behind a feature or prod flag.

Acceptance Criteria:

  1. The edu-eligibilty-criteria-months-remaining-for-use event is replaced with edu-eligibility-criteria-months-remaining-for-use. (Note: Typo (missing second "i" in eligibility)

  2. The event cta-primary-button-click is triggered on each "Exit Application" button: a. /education/other-va-education-benefits/stem-scholarship/apply-for-scholarship-form-22-10203/benefits/initial-confirm-eligibility b. /education/other-va-education-benefits/stem-scholarship/apply-for-scholarship-form-22-10203/benefits/confirm-eligibility

  3. The unnecessary firing of event cta-primary-button-click is removed. (Note: There looks to be a one-off cta-primary-button-click event firing occasionally upon continuing from benefits/stem-eligibility to /benefits/confirm-eligibility and /benefits/eligibility to /benefits/initial-confirm-eligibility we will want to remove. The edu-stem-scholarship-ineligibility-alert and edu-form-change events are perfect here and we will be able to determine those who continue / move back using page URLs.)

  4. The ineligibility alert is tracked on /benefits/initial-confirm-eligibility using the following event:

    'event': edu-stem-scholarship-ineligibility-alert

Supporting Artifacts:

  1. For AC1: image

  2. For AC2: image

  3. For AC3: Screenshot 1 Screenshot 2
    image image

Notes:

cc: @bsmartin-ep and @bmcgrady-ep for visibility

zurbergram commented 4 years ago

https://github.com/department-of-veterans-affairs/vets-website/pull/14081

zurbergram commented 4 years ago

Testing instructions for AC#2 in Chrome

  1. Navigate to either page for A or B

  2. Open Dev Tools

  3. Go to Sources tab

  4. In the Page section, navigate to top/"webpack://"/./src/applications/edu-benefits/10203/ and click on analytics-functions.js

  5. Put a breakpoint on line 39, this should be last line of exitApplication function Screen Shot 2020-09-02 at 9 34 53 AM

  6. Click "Exit Application", breakpoint should be hit

  7. In console type window.dataLayer and hit enter

  8. Observe event is present

Note: after leaving a form, window.dataLayer is cleared so this is how to check event is added

sonntag-adam commented 4 years ago

Screen Shot 2020-09-02 at 11.20.29 AM.png

Screen Shot 2020-09-02 at 11.33.53 AM.png

Screen Shot 2020-09-02 at 11.34.19 AM.png

Screen Shot 2020-09-02 at 11.38.57 AM.png

Screen Shot 2020-09-02 at 11.40.18 AM.png

Screen Shot 2020-09-02 at 12.08.11 PM.png

sonntag-adam commented 4 years ago

In staging. Closing story.