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 support for Pendo Track events #6140

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

chriszarate
Copy link
Member

@chriszarate chriszarate commented Feb 12, 2025

Description

Provide telemetry for Pendo "Track events." These events are conceptually similar to Automattic Tracks events, but have a different payload structure. See an explanation of "Event types" on this page.

Usage is almost identical to that of Automattic Tracks. This PR introduces a generic Telemetry class that will send events to both Automattic Tracks and Pendo. Going forward, we will update our plugins to use the Telemetry class.

In general, I've tried to follow the implementation pattern provided by the existing Tracks implementation and the generic Telemetry base classes and interfaces. I did make some minor changes to the abstract class Telemetry_Event and the extending Tracks_Event class in order to improve the abstraction and reduce code duplication.

New constants will need to be provided in order to configure this functionality automatically:

  • VIP_PENDO_TRACK_INTEGRATION_KEY: The integration API key used to authenticate with Pendo and send Track events. This key can only be used to write (append) events to Pendo's API.
  • VIP_SF_ACCOUNT_ID: The account ID added to event payloads and used to correlate Pendo events.

Note

Client-side Pendo Page/Feature events has moved to #6150

Pre-review checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally or in Codespaces (or has an appropriate fallback).
  • This change works and has been tested on a sandbox.
  • This change has relevant unit tests (if applicable).
  • This change uses a rollout method to ease with deployment (if applicable - especially for large scale actions that require writes).
  • This change has relevant documentation additions / updates (if applicable).
  • I've created a changelog description that aligns with the provided examples.

Pre-deploy checklist

  • VIP staff: Ensure any alerts added/updated conform to internal standards (see internal documentation).

Steps to Test

  1. Check out PR.
  2. Follow README to use the Telemetry class and record events.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 97.51244% with 5 lines in your changes missing coverage. Please review.

Project coverage is 30.99%. Comparing base (2f98ee5) to head (cb9a71c).

Files with missing lines Patch % Lines
telemetry/pendo/pendo-utils.php 93.10% 2 Missing ⚠️
telemetry/class-telemetry-client.php 0.00% 1 Missing ⚠️
telemetry/class-telemetry.php 92.30% 1 Missing ⚠️
telemetry/pendo/class-pendo.php 97.50% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #6140      +/-   ##
=============================================
+ Coverage      30.41%   30.99%   +0.57%     
- Complexity      4830     4879      +49     
=============================================
  Files            290      296       +6     
  Lines          21333    21500     +167     
=============================================
+ Hits            6489     6664     +175     
+ Misses         14844    14836       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@smithjw1 smithjw1 mentioned this pull request Feb 13, 2025
7 tasks
@chriszarate chriszarate force-pushed the add/pendo-track-page-feature-events branch from 3e92aa5 to dd01619 Compare February 20, 2025 00:03
@chriszarate chriszarate changed the title Add support for Pendo Track events and Page/Feature events Add support for Pendo Track events Mar 7, 2025
Copy link

sonarqubecloud bot commented Mar 7, 2025

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.

1 participant