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 and Page/Feature events #6140

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

chriszarate
Copy link
Member

@chriszarate chriszarate commented Feb 12, 2025

Description

Provide Pendo-based telemetry in two main parts:

  • Server-to-server Pendo "Track events" are conceptually similar to Automattic Tracks events, but have a different payload structure. Usage is almost identical to that of Automattic Tracks.
  • Client-side Pendo Page/Feature events require a client library to be enqueued and configured. Moved to Implement Pendo JavaScript library (Page/Feature events) #6150

See an explanation of "Event types" on this page.

In general, I've tried to follow the 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:

  • PENDO_TRACK_SECRET_KEY: The secret integration key used to authenticate with Pendo and send Track events.
  • PENDO_SNIPPET_API_KEY: The (non-secret) client API key used to configure Pendo's JavaScript library.
  • VIP_DISABLE_PENDO_TELEMETRY: If true, prevents the JavaScript library from being enqueued. Server-to-server Pendo Track events are still sent.
  • VIP_SF_ACCOUNT_ID: The account ID added to event payloads and used to correlate Pendo events.

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

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 94.73684% with 10 lines in your changes missing coverage. Please review.

Project coverage is 30.94%. Comparing base (50d93d8) to head (dd01619).

Files with missing lines Patch % Lines
telemetry/pendo/class-pendo-track-client.php 84.61% 6 Missing ⚠️
telemetry/pendo/pendo-utils.php 93.10% 2 Missing ⚠️
telemetry/class-telemetry.php 92.30% 1 Missing ⚠️
telemetry/pendo/class-pendo.php 97.29% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #6140      +/-   ##
=============================================
+ Coverage      30.41%   30.94%   +0.53%     
- Complexity      4830     4878      +48     
=============================================
  Files            290      296       +6     
  Lines          21327    21489     +162     
=============================================
+ Hits            6486     6650     +164     
+ Misses         14841    14839       -2     

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

@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
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