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

Provide link in Analytics settings panel to update GA4 configuration and improve UI for related UA link #3766

Merged

Conversation

danielgent
Copy link
Contributor

@danielgent danielgent commented Jul 27, 2021

Summary

Addresses issue #3702

Relevant technical choices

Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 4.7 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

@google-cla google-cla bot added the cla: yes label Jul 27, 2021
@github-actions
Copy link

github-actions bot commented Jul 27, 2021

Size Change: -2.01 kB (0%)

Total Size: 1.08 MB

Filename Size Change
./dist/assets/js/googlesitekit-activation.********************.js 35.7 kB -45 B (0%)
./dist/assets/js/googlesitekit-adminbar.********************.js 28.1 kB -96 B (0%)
./dist/assets/js/googlesitekit-api.********************.js 9.2 kB -57 B (-1%)
./dist/assets/js/googlesitekit-dashboard-details.********************.js 41.3 kB -138 B (0%)
./dist/assets/js/googlesitekit-dashboard-splash.********************.js 49.8 kB -65 B (0%)
./dist/assets/js/googlesitekit-dashboard.********************.js 41.6 kB -69 B (0%)
./dist/assets/js/googlesitekit-data.********************.js 1.65 kB +5 B (0%)
./dist/assets/js/googlesitekit-datastore-forms.********************.js 8.92 kB -37 B (0%)
./dist/assets/js/googlesitekit-datastore-location.********************.js 2.03 kB +3 B (0%)
./dist/assets/js/googlesitekit-datastore-site.********************.js 13.4 kB -51 B (0%)
./dist/assets/js/googlesitekit-datastore-ui.********************.js 8.89 kB -36 B (0%)
./dist/assets/js/googlesitekit-datastore-user.********************.js 20.3 kB -45 B (0%)
./dist/assets/js/googlesitekit-idea-hub-notice.********************.js 2.42 kB +1 B (0%)
./dist/assets/js/googlesitekit-module.********************.js 41.4 kB -96 B (0%)
./dist/assets/js/googlesitekit-modules-adsense.********************.js 44.1 kB -57 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-4.********************.js 19.1 kB -33 B (0%)
./dist/assets/js/googlesitekit-modules-analytics.********************.js 65.6 kB -243 B (0%)
./dist/assets/js/googlesitekit-modules-idea-hub.********************.js 39.3 kB -234 B (-1%)
./dist/assets/js/googlesitekit-modules-optimize.********************.js 17 kB -61 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights.********************.js 16.5 kB -27 B (0%)
./dist/assets/js/googlesitekit-modules-search-console.********************.js 28.7 kB -39 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager.********************.js 30.1 kB -81 B (0%)
./dist/assets/js/googlesitekit-modules.********************.js 16.6 kB -54 B (0%)
./dist/assets/js/googlesitekit-settings.********************.js 45.9 kB -116 B (0%)
./dist/assets/js/googlesitekit-user-input.********************.js 42.7 kB -140 B (0%)
./dist/assets/js/googlesitekit-vendor.********************.js 314 kB -26 B (0%)
./dist/assets/js/googlesitekit-widgets.********************.js 11.5 kB -56 B (0%)
./dist/assets/js/googlesitekit-wp-dashboard.********************.js 29.9 kB -118 B (0%)
ℹ️ View Unchanged
Filename Size
./dist/assets/css/admin.css 38.1 kB
./dist/assets/css/adminbar.css 7.95 kB
./dist/assets/css/wpdashboard.css 4.55 kB
./dist/assets/js/analytics-advanced-tracking.js 769 B
./dist/assets/js/googlesitekit-base.********************.js 1.57 kB
./dist/assets/js/googlesitekit-i18n.js 3.92 kB
./dist/assets/js/googlesitekit-idea-hub-post-list-notice.********************.js 471 B
./dist/assets/js/runtime.********************.js 763 B

compressed-size-action

@@ -42,6 +42,7 @@ export default function SettingsView() {
const isGA4Enabled = useFeature( 'ga4setup' );
const ga4PropertyID = useSelect( ( select ) => isGA4Enabled ? select( MODULES_ANALYTICS_4 ).getPropertyID() : '' );
const ga4MeasurementID = useSelect( ( select ) => isGA4Enabled ? select( MODULES_ANALYTICS_4 ).getMeasurementID() : '' );
const webDataStreamID = useSelect( ( select ) => isGA4Enabled ? select( MODULES_ANALYTICS_4 ).getWebDataStreamID() : '' );
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs double checking. For me it was opening a web data stream for a totally different property (which makes no sense given the Url includes the correct property!)

<div className="googlesitekit-settings-module__meta-item">
<h5 className="googlesitekit-settings-module__meta-item-type">
&nbsp;
</h5>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easiest and safest way to make the Links vertically aligned as per the AC (but this always feels a bit hacky!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs hiding on mobile (as per updated AC)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make the links sibling elements of their respective DisplaySettings instead. We want the link to be clearly associated with the value and putting it in a separate element like this spaces it in the grid like a separate thing. This also has the potential to wrap on smaller screens where it would lose the positional context as to what it is referring to. Keeping them in the same parent also has the benefit of not requiring a hack to preserve the alignment 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Especially when going onto mobile

What do you think about the spacing? I just added one space.

same row

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does look a little tight but also makes it more clear what the link refers to. I don't think we should get into adding &nbsp;s or another class to add space as this seems a bit arbitrary and makes the link a bit more ambiguous.

What do you think about this?

image

This is how it looks if we also passed the small prop to the Links? I realize the ACs specifically say that it should be the same size but I think it might look a bit better with a reduced size and we have an existing prop to do this. Seeing the options side-by-side would also help make the case for changing that in case we feel it looks better 🙂 We'd have to ask about changing it but I think prefer the smaller link. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it as it is in the ACs for now, we can always follow-up with a super simple PR if we decide to tweak the Link size later.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's anything actionable here for me now @aaemnnosttv ?

<Link
href={ editViewSettingsURL }
external
className="googlesitekit-settings-module__inline-link"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed the safest way to override using CSS without making cascading changes through the whole site

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change of plan: remove this className and instead wrap the links with <p className="googlesitekit-settings-module__meta-item-data">

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my previous comment about placement. If needed, I think the inherit prop of the Link component should be all we need to match the surrounding text.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better. It works

works

Copy link
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @danielgent – this looks good overall. I've left a few comments here as well as replies to some of your annotations. Let me know if you have any questions 👍

<div className="googlesitekit-settings-module__meta-item">
<h5 className="googlesitekit-settings-module__meta-item-type">
&nbsp;
</h5>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make the links sibling elements of their respective DisplaySettings instead. We want the link to be clearly associated with the value and putting it in a separate element like this spaces it in the grid like a separate thing. This also has the potential to wrap on smaller screens where it would lose the positional context as to what it is referring to. Keeping them in the same parent also has the benefit of not requiring a hack to preserve the alignment 👍

<Link
href={ editViewSettingsURL }
external
className="googlesitekit-settings-module__inline-link"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my previous comment about placement. If needed, I think the inherit prop of the Link component should be all we need to match the surrounding text.

Copy link
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @danielgent – this looks good as defined. See my question about the size of the link, but otherwise this looks good to go.

Copy link
Collaborator

@aaemnnosttv aaemnnosttv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I missed an important detail in the last review!

Comment on lines 192 to 196
<DisplaySetting value={ ga4MeasurementID } />
</p>
</div>
<div className="googlesitekit-settings-module__meta-item">
<h5 className="googlesitekit-settings-module__meta-item-type">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how I missed this before, but this is duplicating the output for the Measurement ID
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now!

oops

That's kind of funny. It even has screenshots with the duplicate Measurement Id and we still didn't spot it 😛

@aaemnnosttv aaemnnosttv merged commit 3d6252e into develop Aug 4, 2021
@aaemnnosttv aaemnnosttv deleted the enhancment/3702-link-Analytics-update-GA4-UA-link branch August 4, 2021 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants