question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Analytics Storybook stories slightly broken

See original GitHub issue

Bug Description

Various Analytics setup Storybook stories (e.g. https://google.github.io/site-kit-wp/storybook/main/?path=/story/analytics-module-setup--start-with-matched-property) have the “Configure Analytics” button disabled when it should actually be enabled given the circumstances / UI displayed.

This may have been introduced by some of the GA4 enhancements, where checking these scenarios might have been missed.


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

Acceptance criteria

Implementation Brief

  • In stories/module-analytics-setup.stories.js:
    • Update all stories that use an empty Analytics settings object to use the default settings (fixture.defaultSettings).
      - registry.dispatch( MODULES_ANALYTICS ).receiveGetSettings( {} );
      + registry.dispatch( MODULES_ANALYTICS ).receiveGetSettings( { ...fixtures.defaultSettings } );
      
    • Add default settings for the GA4 module using the ga4Fixtures.defaultSettings fixture to all stories where it is missing.
    • Set an existing tag for the GA4 module to be null in all stories where it is missing.
    • Add properties for the GA4 module using the receiveGetProperties action to all stories where it is missing.
    • Check all stories to make sure the Configure Analytics button is active where it makes sense to be active. If the button is disabled for a story where it should be active, then it means that something is missing in the setup and you need to fix it. You can see what is wrong by adding console.log( error ) call to the catch section of the following try/catch block: https://github.com/google/site-kit-wp/blob/5dcbb1ecd2ae9d0e98cd7552ef38fcf9e22e5a36/assets/js/googlesitekit/data/utils.js#L372-L377

Test Coverage

  • N/A

QA Brief

Changelog entry

  • Fix bug where error for an Analytics property in Tag Manager without access would not show up.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
felixarntzcommented, Dec 10, 2021

@aaemnnosttv Ahh, yeah that makes sense. I think we should remove this line, I don’t think it should cause any problems and it will actually fix a bug 🎉

@techanvil Per the above, can you make this one production code change to remove https://github.com/google/site-kit-wp/blob/e66e6901ccccb4a2aeba1bb408af3af727969863/assets/js/modules/analytics/components/setup/SetupMain.js#L111? This should make the button no longer relevant for that story, which is the correct behavior. Please verify this in the story for that scenario, which should then not require further adjustments.

I’m also gonna update the changelog here since now this issue fixes a user-relevant bug and not “just” broken Storybook stories.

2reactions
aaemnnosttvcommented, Dec 10, 2021

@felixarntz it looks like the ExistingGTMPropertyError is being bypassed here due to the condition requiring no existing tag (not sure why this is here) https://github.com/google/site-kit-wp/blob/e66e6901ccccb4a2aeba1bb408af3af727969863/assets/js/modules/analytics/components/setup/SetupMain.js#L111

In this situation using the current logic, the user should be blocked the same way as if there was an existing tag that they didn’t have permission/access for. Removing the line above fixes this.

image

It’s also worth noting that right now the ExistingGTMPropertyNotice is not rendered as part of the GA4 and GA4Transitional setup forms. Since the notice is always for non-blocking scenarios I think this may have been removed (or not migrated) by mistake. We don’t catch GA4 tags in GTM yet which is out of scope for this issue but I think the component should be here also.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Instagram Stories Analytics: Every Metric You Need to Know
Doing so will pull up a number of important metrics about that story, including link clicks, profile visits, impressions, and a ton more!...
Read more >
Instagram Story Analytics: How to Measure the Metrics that ...
There are a few ways to check analytics for Instagram Stories. We break them down below. But first, make sure you have an...
Read more >
Next-level component showcasing with Storybook controls
Learn about controls, a new Storybook addon that lets you dynamically interact with your React components for demo and testing purposes.
Read more >
Data Storytelling: How to Tell a Story with Data - HBS Online
Data storytelling is the ability to communicate insights from data using narratives and visualizations. Here's how to effectively tell a ...
Read more >
Telemetry - Storybook
Story count. Storybook version. Storybook metadata: Language (e.g., TypeScript, JavaScript). Supported view layers (e.g., React, Vue, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found