Skip to content

Conversation

@miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Aug 9, 2024

All Submissions:

Changes proposed in this Pull Request:

1200550061930446-as-1207615072285532

#2740 introduced tracking capabilities for forms inside the gate, which covers the Reader Registration Block and Checkout Button Block.

There's the unhandled case of registrations initiated via a hash link on the gate, which triggers the RAS' global auth form:

image

To handle those cases, this PR proposes that the tracking input be added to RAS' auth form when visiting gated content.

This means registrations made on gated content, but initiated outside of the gate (like the header "Sign In" button), will also be treated as a gate interaction. To improve accuracy, the tracking input should now only be added once the gate is seen on the page. With that strategy, once the page loads the reader may register through the header "Sign In" and never realize that they are on gated content, which will not be a gate interaction. Once they scroll down and hit the gate, they may scroll back up, register from "Sign In", and it will be a gate interaction.

How to test the changes in this Pull Request:

  1. Check out this branch and make sure you have RAS, Woo Memberships and a configured content gate
  2. Edit your content gate to use the "Paywall with One Tier and Metering" pattern (Patterns -> Newspack Memberships)
  3. In a fresh session, visit a gated article and, without scrolling down, register through the header "Sign In"
  4. Confirm the registration goes through with the registration_method metadata as auth-form
  5. Reset your session and visit a gated article
  6. Scroll down to the gate and register through the "Register for free" link
  7. Confirm the registration goes through with registration_method metadata as registration-block-content-gate
  8. Also confirm the GA events goes through with the following:
{"name":"np_gate_interaction","action":"form_submission_received","action_type":"registration"}
{"name":"np_gate_interaction","action":"form_submission_success","action_type":"registration"}

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 Aug 9, 2024
@miguelpeixe miguelpeixe self-assigned this Aug 9, 2024
@miguelpeixe miguelpeixe requested a review from a team as a code owner August 9, 2024 13:23
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 Aug 9, 2024
@miguelpeixe miguelpeixe merged commit eb06194 into trunk Aug 9, 2024
@miguelpeixe miguelpeixe deleted the fix/data-events-gate-interaction-registration branch August 9, 2024 18:16
matticbot pushed a commit that referenced this pull request Aug 15, 2024
# [5.1.0-alpha.1](v5.0.1...v5.1.0-alpha.1) (2024-08-15)

### Bug Fixes

* **data-events:** gate interaction for registration form ([#3327](#3327)) ([eb06194](eb06194))
* **ras:** destroy sessions on account verification ([#3328](#3328)) ([ab6efeb](ab6efeb))

### Features

* add phpcs sniff for newsletter methods ([#3337](#3337)) ([15f237c](15f237c))
* add woo team sync metadata (WIP) ([#3325](#3325)) ([e5cc5e3](e5cc5e3))
@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

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

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.3.0-hotfix-memberships-prop-exists.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

matticbot pushed a commit that referenced this pull request Aug 26, 2024
# [5.3.0](v5.2.1...v5.3.0) (2024-08-26)

### Bug Fixes

* **data-events:** gate interaction for registration form ([#3327](#3327)) ([eb06194](eb06194))
* **ras:** destroy sessions on account verification ([#3328](#3328)) ([ab6efeb](ab6efeb))

### Features

* add phpcs sniff for newsletter methods ([#3337](#3337)) ([15f237c](15f237c))
* add woo team sync metadata (WIP) ([#3325](#3325)) ([e5cc5e3](e5cc5e3))
@matticbot
Copy link
Contributor

🎉 This PR is included in version 5.3.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants