-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
310 - Revise gtag script and add trackExperimentPageClick to search card components #374
Conversation
…and SearchCardFooter (was missing), change the passed argument values for gtag.trackDownloadRnaSeqCompendia in compendia's Download component, revise gtag.trackRegeneratedDataset and dimensions and adjust its comment, fix any bugs found during debugging
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
src/analytics/gtag.js
Outdated
@@ -101,7 +102,7 @@ const trackExploredUsageClick = (link) => { | |||
} | |||
// tracks internal and external link clicks | |||
const trackLink = (link) => { | |||
if (link.startsWith('http')) { | |||
if (typeof link === 'string' && link.startsWith('http')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this fix has already been added the pending PR #369 (to prevent an error encountered during the development), I've also added here for the same reason.
'dataset_id', | ||
'one_off_experiment_download', | ||
'regenerated_download_options_change', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix of this dimension name has been changed to regenerated
to differentiate between the dataset and the regenerative dataset.
@@ -51,6 +51,7 @@ const supportedDimensions = [ | |||
'filter_combination', | |||
'filter_type', | |||
'toggled_filter_item', | |||
'shared_dataset_id', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the shared
prefix has been added to the shared dataset to differentiate it from the dataset in GA report.
src/analytics/helpers.js
Outdated
const initial = datasetOptionsKeys | ||
.map((key) => `${getReadable(key, dataset[key])}`) | ||
.join('|') | ||
|
||
if (regeneratedDataset) { | ||
const changes = datasetOptionsKeys | ||
.map((key) => `${getReadable(key, regeneratedDataset[key])}`) | ||
.join('|') | ||
|
||
return `${initial} -> ${changes}` | ||
} | ||
|
||
return initial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've revised this method to return the download options changes if any, otherwise returns the initial
download options value.
src/components/Compendia/Download.js
Outdated
const response = await downloadCompendia(id) | ||
gtag.trackCompendiaDownload(response) | ||
gtag.trackCompendiaDownload(userSelectedOrganism) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A wrong argument value was passed here, thus I've corrected.
@@ -14,6 +15,11 @@ export const SearchCardHeader = ({ | |||
const { search, setSearch } = useSearchManager() | |||
const { setResponsive } = useResponsive() | |||
|
|||
const handleClick = () => { | |||
setSearch({ ...search, ref: 'search' }) | |||
gtag.trackExperimentPageClick(SearchCardHeader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, I've included the missing tracking method here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but lets remove the changes that override the decisions made in earlier PRs
Make sure to overwrite the following methods:
NOTE: For the second item, the components that calls --Update-- Epic #358 (branch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one comment looks good though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue Number
Epic: #302
Related Issue #310
Purpose/Implementation Notes
I've revised the
gtag
script and dimension names, and included the missinggtag.trackExperimentPageClick
method toSearchCardHeader
andSearchCardFooter
based on local debugging while setting up theRefine.bio Web -Dev
property in the analytics account.I've completed the setup for #310 and it is ready for your review. Thank you David!
Types of changes
Functional tests
N/A
Checklist
Screenshots
N/A