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

Consolidate bf_count data layer event with bf_page_change #1538

Closed
nickpistone opened this issue Jul 8, 2024 · 5 comments · Fixed by #1551
Closed

Consolidate bf_count data layer event with bf_page_change #1538

nickpistone opened this issue Jul 8, 2024 · 5 comments · Fixed by #1551
Assignees
Milestone

Comments

@nickpistone
Copy link
Collaborator

nickpistone commented Jul 8, 2024

Description

The bf_count event fires when users see the results page and it carries three data layer variables (eligible, ineligible, and more info). Since the user is only doing one action (viewing the results page), we would like to consolidate all of that data into one event and apply the three variables mentioned above to the bf_page_change event when the users reaches the results pages. So the variables would function the same way, but they would be part of the page_change event rather than in their own separate event (bf_count). After that is done, we can delete bf_count.

User Story

As a data analyst, I want to simplify tracking to make data collection processes more reliable and less susceptible to breaking; as well as simplify reporting.

Acceptance Criteria

-3 data layer variables (eligible, not-eligible, and more-info) are associated with the page_change event rather than the bf_count event
-Benefit count variables (eligible, not eligible, more info) pass the value as both a numeric value and a string

@scottqueen-bixal
Copy link
Collaborator

    event: 'bf_page_change',
    bfData: {
      pageView: {one of ['bf-result-eligible-view', 'bf-result-not-eligible-view'],}
      viewTitle: {heading}
      viewState: {one of [
        'bf-not-eligible-view',
        'bf-eligible-view',
        'bf-not-eligible-view-zero-benefits',
        'bf-eligible-view-zero-benefits',
      ]},
     eligible: {number},
     notEligible: {number},
     moreInfo: {number}
    },

@nickpistone
Copy link
Collaborator Author

If possible, I'd like to pass the number of eligible benefits as both a string and as a number. That would allow me to use the data in different ways. So here's what I propose. Feel free to come back with a counter. I'm not tied to specific naming, but more to the concepts. Also, I'd like to get rid of the zero-benefits values altogether since we can get that info from the eligible benefit count. I also removed viewState from the array since we discussed removing it in another ticket.

event: 'bf_page_change',
bfData: {
pageView: {one of ['bf-result-eligible-view', 'bf-result-not-eligible-view'],}
viewTitle: {heading}
eligibleBenefitCount: {number},
notEligibleBenefitCount: {number},
moreInfoBenefitCount: {number}
eligibleBenefitString: {"number"},
notEligibleBenefitString: {"number"},
moreInfoBenefitString: {"number"}
},

Here's an example of what these values might look like when someone completes the form and views their eligible benefits.

event: 'bf_page_change',
bfData: {
pageView: bf-result-eligible-view
viewTitle: Your potential benefits

 eligibleBenefitCount: 3
 notEligibleBenefitCount: 12
 moreInfoBenefitCount: 8

eligibleBenefitString: "3"
notEligibleBenefitString: "12"
moreInfoBenefitString: "8"
},

@scottqueen-bixal
Copy link
Collaborator

I would typically return both values assigned to one key and you would just de-structure on your end.

for example eligibleBenefitCount: { number: {number}, string: {"number"}}

Then your dot notation would just be eligibleBenefitCount.number or eligibleBenefitCount.string to get the value type you prefer

Is there any reason this wouldn't work?

@nickpistone
Copy link
Collaborator Author

I have no problem with that. Let's try it.

@nickpistone
Copy link
Collaborator Author

Confirmed
(tracking my own work on this with #1556)

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 a pull request may close this issue.

2 participants