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
281 stars 197 forks source link

Telephone Click Events - Adding Header Information #39329

Open mmiddaugh opened 2 years ago

mmiddaugh commented 2 years ago

Analytics Feature Request/Bug Report

What this form is for

Use this template to request an Analytics dashboard feature or report a dashboarding or Google Analytics/Google Tag Manager bug. This form is for enhancements to the existing KPI dashboards. If you have any analytics questions, please use the /support command on #vfs-platform-support channel in Slack, or attend one of our office hours.

Platform Analytics & Insights will use the information you provide to help improve our products and services.

Instructions

Please fill out the following sections:

Ticket Description

Who is this request for?

Request/Report Description

For a new feature request:

Description of desired feature

Example situation: Cape Cod Vet Center Locations page displays 5+ different locations, all intentionally displaying the same phone number. The main Cape Cod Center page also displays this phone number in the contact info section, at a minimum.

Who is your audience?

Product questions to think through if you're requesting new data features:

Additional Comments

Add any comments or questions for the Platform Analytics & Insights team here (if applicable).

Please leave the following blank

Acceptance Criteria

For features:

For bugs:

Definition of Done

michelle-dooley commented 2 years ago

@mmiddaugh thanks for your request. We will work on making this update for you.

michelle-dooley commented 2 years ago

@obrienjulie adding note here to include the "section-label" values work in this as discussed.

chloedotbrown commented 2 years ago

@bsmartin-ep Thanks for taking a look at this!

chloedotbrown commented 2 years ago

Hi @obrienjulie - I think I've come up with a potential solution for our Standardized Content and Content Last Week views in BigQuery that would solve the "section - label" issue.

The issue seems to be in lines the part of the view where the link_label field is created for different engagement types. I've made changes to the delimiter used in the SPLIT function so as to not process interior dashes. I've also added conditions so that the 4th offset doesn't get concatenated when the value is "(not set)". I've been running on test table content_accordions, though I'll delete that once we've resolved.

Give it a look and let me know what you think! If this seems good, let's update the views and backfill to Domo?

Link label changes


CASE WHEN hits.eventInfo.eventLabel = 'gtm.linkClick' THEN hits.eventInfo.eventAction
     WHEN REGEXP_CONTAINS(hits.eventinfo.eventLabel,'link') 
          THEN TRIM(SPLIT(hits.eventInfo.eventAction,'-')[SAFE_OFFSET(2)])
     WHEN REGEXP_CONTAINS(hits.eventinfo.eventLabel,'^cta-(button|default|primary|secondary)-*') 
          THEN TRIM(SPLIT(hits.eventInfo.eventAction,'-')[SAFE_OFFSET(1)]) 
  -- Current version of accordion link_label (lines 123-125 in BigQuery version)
     WHEN REGEXP_CONTAINS(hits.eventinfo.eventLabel,'^(nav|int)-accordion-(expand|)') 
          THEN CONCAT(TRIM(SPLIT(hits.eventInfo.eventAction,'-')[SAFE_OFFSET(3)]),
               CASE WHEN TRIM(SPLIT(hits.eventInfo.eventAction,'-')[SAFE_OFFSET(4)]) IS NULL 
                    THEN '' ELSE ' - ' END,
               IFNULL(TRIM(SPLIT(hits.eventInfo.eventAction,'-')[SAFE_OFFSET(4)]),'')) END as link_label
  -- Proposed replacement
     WHEN REGEXP_CONTAINS(hits.eventinfo.eventLabel,'^(nav|int)-accordion-(expand|)') 
          THEN CONCAT(TRIM(SPLIT(hits.eventinfo.eventAction,' - ')[SAFE_OFFSET(3)]), 
               CASE WHEN TRIM(SPLIT(hits.eventinfo.eventAction,' - ')[SAFE_OFFSET(4)]) IS NULL 
                    OR TRIM(SPLIT(hits.eventinfo.eventAction,' - ')[SAFE_OFFSET(4)]) LIKE '(not set)' 
                         THEN '' ELSE ' - ' END, 
               CASE WHEN TRIM(SPLIT(hits.eventinfo.eventAction,' - ')[SAFE_OFFSET(4)]) IS NULL 
                    OR TRIM(SPLIT(hits.eventinfo.eventAction,' - ')[SAFE_OFFSET(4)]) LIKE '(not set)' 
                    THEN '' ELSE TRIM(SPLIT(hits.eventinfo.eventAction,' - ')[SAFE_OFFSET(4)]) END) END as link_label
obrienjulie commented 2 years ago

Thanks @chloedotbrown. I'll review the changes today.

obrienjulie commented 2 years ago

@chloedotbrown - Changes are now reflecting in Domo.

chloedotbrown commented 2 years ago

(shared in Slack)

Believe I solved the null link_label issue in the Content data. Issue was that when the new lines to fix the "section - label" issue were aded to the BQ views, they overwrote the condition for buttons, which caused 100% of buttons and accordion link_labels were blank. Still not quite sure why this impacted accordions as well, but adding it back in seems to resolve the issue.

Screenshots attached show:

  1. where the issue occurred
  2. percent null link_labels by engagement type for original approach, current code, and new version.

While 12% of button labels are still null, this matches the original null rate. It may be something we want to look into eventually, but it should be considered a separate issue. I'm backfilling the Content data now and will pop back online this evening to check/reset it once it's done. Assuming everything's good, I'll delete the views I made to investigate on Monday to clean up BQ.

@obrienjulie before we close out ticket - should we also huddle around the phone number issue that was originally listed in this ticket?

Screen Shot 2022-04-29 at 12 36 54 PM

Screen Shot 2022-04-29 at 1 09 06 PM

chloedotbrown commented 2 years ago

Update on the telephone number event issues in the original ticket - 1) duplicate events firing for single link click and 2) event labels not including which section of the page the link was clicked on.

For the first issue, it looks like there is a second tag (Call Facility Telephone - tel: prefix) configured for Vet Center pages only, in addition to the telephone number click tag used across the whole site (Outbound Link Clicked: tel: prefix). To clean up how the data appears on the Standardized Content dashboard card, we've added a filter to exclude the duplicate tag.

As for tracking which section of the site a link was clicked under, this will require some additional GTM work. @bsmartin-ep is working on a way to add this info to all outbound phone number clicks, and we'll meet to discuss next week.

jennaouellet commented 2 years ago

Hi @mmiddaugh! I'm picking up the GTM work where Brian left off. We can create a custom dataLayer variable where you will have to manually pass in the heading section for the clicks, or we can use an existing variable that we have which reports on the closest parent class div name from the HTML. Do either of these sound like a solution you'd like to pursue?

mmiddaugh commented 2 years ago

Looping in @dsinla who now has responsibility for the Vet Center product

michelle-dooley commented 2 years ago

Hi @dsinla - just following up on this, let us know how you would like to proceed based on note above. Thanks!!

dsinla commented 2 years ago

@michelle-dooley Sorry I must have missed this earlier, thanks for re-pinging. I'm not familiar enough with a lot of the detail here to weigh in on @jennaouellet's question. I would benefit from a meeting where one of you could bring me up to speed. I will put 30 mins on your calendars if one of you has some time.

davidmpickett commented 1 year ago

@kmariepat-cityfriends ^ Vet Center analytics request

johnny-jesensky-adhoc commented 6 months ago

Hi @mmiddaugh, the Analytics Team has been going through the backlog at some older tickets. Is this still relevant a need for your team?

If so, we'd like to meet to determine some next steps.