Skip to content

Conversation

@miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Nov 16, 2023

All Submissions:

Changes proposed in this Pull Request:

Removes the use of ActionScheduler for dispatching data events. It should use the fallback strategy in place for when AS is not available, which is to send an unblocking HTTP request.

The reason for this change is that the amount of data events we dispatch drastically increased, especially with Newspack Newsletters' tracking functionality. This can be too much for AS' queue to handle.

This change shouldn't impact the processing or reliability of data events, since this is already the strategy in place for sites without AS available (without WooCommerce installed).

Update: 30ff764 adds a check for a WC function on the GA4 connector so it doesn't fatal if WC is not installed.

How to test the changes in this Pull Request:

  1. Checkout this branch, make sure you have GA4 connected and define( 'NEWSPACK_LOG_LEVEL', 2 );
  2. Make sure you also have a global webhook configured in Newspack -> Connections. Make sure you have define( 'NEWSPACK_EXPERIMENTAL_WEBHOOKS', true );. You can use https://webhook.site/ to register a test endpoint
  3. Go through the RAS registration flow and confirm the dispatches are logged, e.g.: Dispatching action "reader_logged_in".
  4. Confirm you see the events also reaching GA4 through GA's real-time report page.
  5. Confirm the request also reached the webhook endpoint

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@miguelpeixe miguelpeixe added the [Status] Needs Review The issue or pull request needs to be reviewed label Nov 16, 2023
@miguelpeixe miguelpeixe requested a review from a team as a code owner November 16, 2023 15:48
@miguelpeixe miguelpeixe self-assigned this Nov 16, 2023
Copy link
Contributor

@leogermani leogermani left a comment

Choose a reason for hiding this comment

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

Works well!

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Nov 21, 2023
@miguelpeixe miguelpeixe merged commit 975ab96 into master Nov 21, 2023
@miguelpeixe miguelpeixe deleted the fix/data-events-remove-actionscheduler branch November 21, 2023 17:35
matticbot pushed a commit that referenced this pull request Nov 30, 2023
# [2.12.0-alpha.1](v2.11.3...v2.12.0-alpha.1) (2023-11-30)

### Bug Fixes

* **checkout:** move stripe's cover fee placement ([#2767](#2767)) ([5f8b539](5f8b539))
* **data-events:** no longer use ActionScheduler for dispatches ([#2755](#2755)) ([975ab96](975ab96))
* **metering:** restrict comments on gated content ([#2751](#2751)) ([1bfc6f0](1bfc6f0))
* **recaptcha:** refresh token on checkout error ([#2769](#2769)) ([f22e8bd](f22e8bd))

### Features

* add filters for assets enqueueing ([#2768](#2768)) ([fcad059](fcad059))
* **authentication:** rate limit magic links and OTP generation ([#2765](#2765)) ([1252515](1252515))
* **campaigns:** mark duplicate segments ([cb5b527](cb5b527))
* **data-events:** track content gate interactions ([#2740](#2740)) ([298fd7c](298fd7c))
* **donations:** disable coupons for donation checkout ([#2770](#2770)) ([6051429](6051429))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.12.0-alpha.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Dec 11, 2023
# [2.12.0](v2.11.6...v2.12.0) (2023-12-11)

### Bug Fixes

* **checkout:** move stripe's cover fee placement ([#2767](#2767)) ([5f8b539](5f8b539))
* **data-events:** no longer use ActionScheduler for dispatches ([#2755](#2755)) ([975ab96](975ab96))
* **metering:** restrict comments on gated content ([#2751](#2751)) ([1bfc6f0](1bfc6f0))
* **recaptcha:** refresh token on checkout error ([#2769](#2769)) ([f22e8bd](f22e8bd))

### Features

* add filters for assets enqueueing ([#2768](#2768)) ([fcad059](fcad059))
* **authentication:** rate limit magic links and OTP generation ([#2765](#2765)) ([1252515](1252515))
* **campaigns:** mark duplicate segments ([cb5b527](cb5b527))
* **data-events:** track content gate interactions ([#2740](#2740)) ([298fd7c](298fd7c))
* **donations:** disable coupons for donation checkout ([#2770](#2770)) ([6051429](6051429))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 2.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @alpha released [Status] Approved The pull request has been reviewed and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants