Automattic / newspack-popups

Popup notifications.
GNU General Public License v2.0
70 stars 17 forks source link

fix: ga4 events #1277

Closed adekbadek closed 6 months ago

adekbadek commented 7 months ago

All Submissions:

Changes proposed in this Pull Request:

Fixes above-header GA4 event handling.

Also simplifies the element selectors – @dkoo or @leogermani I'd be grateful for a review here since you were involved with the original implementation (https://github.com/Automattic/newspack-popups/pull/1136).

How to test the changes in this Pull Request:

  1. On trunk, create a new above-header prompt. Insert a link (make it at #hash link for convenience)
  2. Create an inline prompt, also with a link
  3. Ensure you have GA4 configured via Site Kit
  4. Use an extension or simply monitor collect requests in the network tab
  5. Click the links in both prompts, observe that only the inline one triggers a GA4 event to be sent
  6. Switch to this branch, observe that both prompts trigger a GA4 event when then link within is clicked

Other information:

matticbot commented 6 months ago

:tada: This PR is included in version 2.31.1-alpha.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

matticbot commented 6 months ago

:tada: This PR is included in version 2.31.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: