-
Notifications
You must be signed in to change notification settings - Fork 70
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
Add upgrade notice if property ID starts with "UA" #321
Add upgrade notice if property ID starts with "UA" #321
Conversation
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.
Thanks for the change, it worked as expected. I can see the notice being shown when the property ID set to UA-xxx
. I just left some questions that I wasn't very sure for discussion.
'notice notice-error', | ||
sprintf( | ||
/* translators: 1) URL for Google documentation on upgrading from UA to GA4 2) URL to WooCommerce Google Analytics settings page */ | ||
__( 'Your website is configured to use Universal Analytics which Google retired in July of 2023. Update your account using the <a href="%1$s" target="_blank">setup assistant</a> and then update your <a href="%2$s">WooCommerce settings</a>.', 'woocommerce-google-analytics-integration' ), // phpcs:ignore WordPress.Security.EscapeOutput |
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'm thinking if using esc_html__
would be better even though we are not using any variables in the string. I slightly lean towards to escape it like the code below to show privacy policy so it would be more consistent and also it could keep the string safe if we were to use the variables inside it in the future.
woocommerce-google-analytics-integration/includes/class-wc-google-analytics.php
Lines 432 to 437 in fd97569
$policy_text = sprintf( | |
/* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */ | |
esc_html__( 'By using this extension, you may be storing personal data or sharing data with an external service. %1$sLearn more about what data is collected by Google and what you may want to include in your privacy policy%2$s.', 'woocommerce-google-analytics-integration' ), | |
'<a href="https://support.google.com/analytics/answer/7318509" target="_blank">', | |
'</a>' | |
); |
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.
Updated in 1f0b6fc
sprintf( | ||
/* translators: 1) URL for Google documentation on upgrading from UA to GA4 2) URL to WooCommerce Google Analytics settings page */ | ||
__( 'Your website is configured to use Universal Analytics which Google retired in July of 2023. Update your account using the <a href="%1$s" target="_blank">setup assistant</a> and then update your <a href="%2$s">WooCommerce settings</a>.', 'woocommerce-google-analytics-integration' ), // phpcs:ignore WordPress.Security.EscapeOutput | ||
'https://support.google.com/analytics/answer/9744165?sjid=9632005471070882766-EU#zippy=%2Cin-this-article', |
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.
❔ Does the parameter sjid=9632005471070882766-EU
has a special meaning? If not I think we could just use the link https://support.google.com/analytics/answer/9744165.
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.
Thanks for picking up on that!
Hey @ianlin, many thanks for the review! I've made the changes you suggested so this is ready for another look 👀 |
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.
Thanks for the extra changes, LGTM 👍
Changes proposed in this Pull Request:
Adds an admin notice if the stored property ID begins with "UA" prompting merchants to use Google's setup assistant and then update their WooCommerce settings.
Screenshots:
Detailed test instructions:
add/ua-update-notice
on a site with theGoogle Analytics Tracking ID
set toUA-.....
G-
Changelog entry