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

"Top traffic source driving leads" showing empty data for 90 days #10043

Open
1 task
wpdarren opened this issue Jan 16, 2025 · 2 comments
Open
1 task

"Top traffic source driving leads" showing empty data for 90 days #10043

wpdarren opened this issue Jan 16, 2025 · 2 comments
Labels
Module: Analytics Google Analytics module related issues Next Up Issues to prioritize for definition P0 High priority Team S Issues for Squad 1 Type: Bug Something isn't working

Comments

@wpdarren
Copy link
Collaborator

wpdarren commented Jan 16, 2025

Bug Description

The "Top traffic source driving leads" is unexpectedly showing empty data for the 90 day range:

image.png

It's showing data as expected for e.g. 28 days:
image.png

Note that there was a row of data returned in my validation report for the 90 day range:
image.png


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Top traffic source driving leads key metrics widget should return correct data for date ranges

Implementation Brief

  • In assets/js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingLeadsWidget.js
    • Update existing function
      function getDateRangeIndex( reportRows, dateRangeSlug ) {
      it should dynamically retrieve the row index, instead of always looking in the 0 - reportRows?.[ 0 ]
    • Loop through the reportRows first, and then apply existing search for the index of dateRangeSlug in each row, once found, dynamically update the row index and existing dateRange index
    • So, modified function will look something like this:
function getDateRangeIndex( reportRows, dateRangeSlug ) {
	let rowIndex = 0;
	let dateRange = 0;

	for ( const reportRow of reportRows ) {
		const foundDateRange = reportRow?.dimensionValues?.find(
			( dimension ) => dimension.value === dateRangeSlug
		);
		if ( foundDateRange ) {
			rowIndex = reportRows.indexOf( reportRow );
			dateRange = foundDateRange;
		}
	}

	const dateRangeIndex =
		reportRows?.[ rowIndex ]?.dimensionValues?.indexOf( dateRange );

	return dateRangeIndex;
}

Test Coverage

  • No updates needed

QA Brief

Changelog entry

@wpdarren wpdarren added Module: Analytics Google Analytics module related issues P0 High priority Type: Bug Something isn't working labels Jan 16, 2025
@zutigrm zutigrm assigned zutigrm and unassigned zutigrm Jan 16, 2025
@binnieshah binnieshah added the Team S Issues for Squad 1 label Jan 17, 2025
@10upsimon 10upsimon self-assigned this Jan 21, 2025
@10upsimon
Copy link
Collaborator

@zutigrm AC ✅

@10upsimon 10upsimon removed their assignment Jan 21, 2025
@zutigrm zutigrm self-assigned this Jan 21, 2025
@binnieshah binnieshah added the Next Up Issues to prioritize for definition label Jan 21, 2025
@zutigrm zutigrm removed their assignment Jan 21, 2025
@10upsimon 10upsimon self-assigned this Jan 22, 2025
@10upsimon
Copy link
Collaborator

Thanks @zutigrm IB LGTM ✅ Moving to EB. I do recall seeing a helper function in one of the widgets to get the dynamic index, I believe added by Arafat. If I find it, I'll reference it in this issue for the engineer.

@10upsimon 10upsimon removed their assignment Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Analytics Google Analytics module related issues Next Up Issues to prioritize for definition P0 High priority Team S Issues for Squad 1 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants