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

Add GA tracking for RRM CTA placement settings #10456

Merged
merged 5 commits into from
Mar 21, 2025

Conversation

nfmohit
Copy link
Collaborator

@nfmohit nfmohit commented Mar 17, 2025

Summary

Addresses issue:

Relevant technical choices

This PR adds opt-in GA event tracking for the new Reader Revenue Manager CTA placement settings.

PR Author 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 5.2 and PHP 7.4.
  • 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/).

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

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

Copy link

github-actions bot commented Mar 17, 2025

Build files for fd06cda have been deleted.

Copy link

github-actions bot commented Mar 17, 2025

Size Change: +385 B (+0.02%)

Total Size: 2.09 MB

ℹ️ View Unchanged
Filename Size Change
./dist/assets/css/googlesitekit-admin-css-********************.min.css 64.1 kB 0 B
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.8 kB 0 B
./dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 846 B 0 B
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 8.48 kB 0 B
./dist/assets/js/33-********************.js 2.76 kB 0 B
./dist/assets/js/34-********************.js 2.25 kB 0 B
./dist/assets/js/35-********************.js 3.64 kB 0 B
./dist/assets/js/36-********************.js 936 B 0 B
./dist/assets/js/37-********************.js 892 B 0 B
./dist/assets/js/38-********************.js 1.61 kB 0 B
./dist/assets/js/39-********************.js 1.57 kB 0 B
./dist/assets/js/40-********************.js 1.61 kB 0 B
./dist/assets/js/41-********************.js 1.59 kB 0 B
./dist/assets/js/42-********************.js 1.83 kB 0 B
./dist/assets/js/43-********************.js 3.11 kB 0 B
./dist/assets/js/analytics-advanced-tracking-********************.js 901 B 0 B
./dist/assets/js/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css 124 B 0 B
./dist/assets/js/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.js 492 B 0 B
./dist/assets/js/blocks/reader-revenue-manager/block-editor-plugin/index.js 7.97 kB 0 B
./dist/assets/js/blocks/reader-revenue-manager/common/editor-styles.css 307 B 0 B
./dist/assets/js/blocks/reader-revenue-manager/common/editor-styles.js 491 B 0 B
./dist/assets/js/blocks/reader-revenue-manager/contribute-with-google/index.js 9.12 kB 0 B
./dist/assets/js/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js 8.62 kB 0 B
./dist/assets/js/blocks/reader-revenue-manager/subscribe-with-google/index.js 9.13 kB 0 B
./dist/assets/js/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js 8.63 kB 0 B
./dist/assets/js/blocks/sign-in-with-google/editor-styles.css 84 B 0 B
./dist/assets/js/blocks/sign-in-with-google/editor-styles.js 492 B 0 B
./dist/assets/js/blocks/sign-in-with-google/index.js 18.1 kB 0 B
./dist/assets/js/googlesitekit-activation-********************.js 23.9 kB +1 B (0%)
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 54.5 kB -9 B (-0.02%)
./dist/assets/js/googlesitekit-adminbar-********************.js 34.8 kB -2 B (-0.01%)
./dist/assets/js/googlesitekit-api-********************.js 10.1 kB -2 B (-0.02%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 6.45 kB +2 B (+0.03%)
./dist/assets/js/googlesitekit-components-gm3-********************.js 10.1 kB 0 B
./dist/assets/js/googlesitekit-consent-mode-********************.js 25.6 kB 0 B
./dist/assets/js/googlesitekit-data-********************.js 2.38 kB +2 B (+0.08%)
./dist/assets/js/googlesitekit-datastore-forms-********************.js 8.96 kB +1 B (+0.01%)
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.09 kB 0 B
./dist/assets/js/googlesitekit-datastore-site-********************.js 20.3 kB +2 B (+0.01%)
./dist/assets/js/googlesitekit-datastore-ui-********************.js 10 kB -1 B (-0.01%)
./dist/assets/js/googlesitekit-datastore-user-********************.js 28.4 kB +1 B (0%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 85.7 kB +62 B (+0.07%)
./dist/assets/js/googlesitekit-events-provider-contact-form-7-********************.js 646 B 0 B
./dist/assets/js/googlesitekit-events-provider-easy-digital-downloads-********************.js 624 B 0 B
./dist/assets/js/googlesitekit-events-provider-mailchimp-********************.js 630 B 0 B
./dist/assets/js/googlesitekit-events-provider-ninja-forms-********************.js 712 B 0 B
./dist/assets/js/googlesitekit-events-provider-optin-monster-********************.js 675 B 0 B
./dist/assets/js/googlesitekit-events-provider-popup-maker-********************.js 634 B 0 B
./dist/assets/js/googlesitekit-events-provider-woocommerce-********************.js 657 B 0 B
./dist/assets/js/googlesitekit-events-provider-wpforms-********************.js 633 B 0 B
./dist/assets/js/googlesitekit-i18n-********************.js 3.93 kB 0 B
./dist/assets/js/googlesitekit-main-dashboard-********************.js 164 kB +3 B (0%)
./dist/assets/js/googlesitekit-metric-selection-********************.js 52.7 kB +5 B (+0.01%)
./dist/assets/js/googlesitekit-modules-********************.js 22.4 kB -29 B (-0.13%)
./dist/assets/js/googlesitekit-modules-ads-********************.js 50.5 kB +7 B (+0.01%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 117 kB +7 B (+0.01%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 194 kB +9 B (0%)
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 22.9 kB -1 B (0%)
./dist/assets/js/googlesitekit-modules-reader-revenue-manager-********************.js 47.4 kB +320 B (+0.68%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 69.9 kB -17 B (-0.02%)
./dist/assets/js/googlesitekit-modules-sign-in-with-google-********************.js 32.9 kB +1 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 32.2 kB +5 B (+0.02%)
./dist/assets/js/googlesitekit-notifications-********************.js 44.7 kB +14 B (+0.03%)
./dist/assets/js/googlesitekit-polyfills-********************.js 377 B 0 B
./dist/assets/js/googlesitekit-settings-********************.js 129 kB +11 B (+0.01%)
./dist/assets/js/googlesitekit-splash-********************.js 69.3 kB -6 B (-0.01%)
./dist/assets/js/googlesitekit-user-input-********************.js 44.1 kB +7 B (+0.02%)
./dist/assets/js/googlesitekit-vendor-********************.js 324 kB -8 B (0%)
./dist/assets/js/googlesitekit-widgets-********************.js 105 kB -11 B (-0.01%)
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 63.2 kB +8 B (+0.01%)
./dist/assets/js/runtime-********************.js 1.4 kB +3 B (+0.21%)

compressed-size-action

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Hey @nfmohit, this is looking good, with the caveat that I think we should modify the approach for tracking these events, but as mentioned in a separate comment we can address that in a followup issue.

I have left a few minor comments to address here, please take a look.

const publicationAvailable = useSelect( ( select ) => {
if ( hasModuleAccess === undefined ) {
return undefined;
// Track GA event when snippet mode or post types change.
Copy link
Collaborator

@techanvil techanvil Mar 21, 2025

Choose a reason for hiding this comment

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

This is not a great approach for tracking the events. It's hard to reuse and maintain, and it could be easy to introduce a bug here in future.

It meets the AC and IB, so considering where we are time-wise I'm not going to suggest changing it here, but we should refactor this to use an approach where the event tracking is more directly tied to the save action.

I do gather the IB initially specced tracking these event in the datastore, I think this would be fine but as @hussain-t pointed out there's no easy way to provide the view context to these events from the datastore at present. However, we do have an issue in the pipeline to create a selector for retrieving the view context.

Anyhow, as mentioned let's leave this for now, I've created a followup issue where we can address the above: #10502

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree with the above. Thank you for opening the new issue 🙇

@nfmohit nfmohit requested a review from techanvil March 21, 2025 16:18
Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

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

Thanks, @nfmohit. LGTM!

Note that I've confirmed the failing E2E test is unrelated to the changes in this PR.

@techanvil techanvil merged commit bfdc6d9 into develop Mar 21, 2025
28 of 29 checks passed
@techanvil techanvil deleted the enhancement/#10332-cta-placement-ga-events branch March 21, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants