Skip to main content
Gainsight Inc.

Custom Events and Global Context

This article explains how to use Custom Events and Global Context.


When the Gainsight PX tag is installed on a product, the code snippet starts picking up events and sends the following product usage event types to PX:

  • Session/Visits
  • Page Loads
  • Link Clicks
  • Button Clicks

Custom Events

Custom Events are unique/useful when product/UX/CS teams are ready to take product usage data to the next level. Specifically, custom events are special in that they also can "carry" with them contextual information along with that event. Thus, instantly opening up a wide range of use cases specific to the product, business, process, goals, etc.

Use Case 1

A product has a feature that allows users to send emails out. And, a custom event call would be made when a user sends the email out. The custom event is not only state that the email was sent but it can include properties/payload such as number of targeted recipients, Is Test Send, and scheduled send day/time.

Gainsight PX would therefore collect these events with those properties tied to the event and they can be used in PX as "first-class citizen” events allowing PX to use them across PX full feature set. For example:

  • In-App Dialog: Immediately triggers an engagement that says “Congratulations on your first email send. This looks like a test send, please refer to our other articles for more information..."

  • Email: Schedule a PX email to go out that congratulates them on their first send.

  • Provide deep analytics on how many email sends were sent to more than 1000 recipients or how many were test sends, etc.

Use Case 2

Your product has some search capability. A custom event call would be made when one of your users performs a search, that will not only tell PX that a search event occurred but it can also include properties/payload such as the search term(s), number of results returned, page search performed against, and search filters, etc..

Just as before, PX would collect these events across their product’s usage allowing PX to do everything is was built to do. For example:

  • In-app dialog/guide: If results = 0 then show dialog with tips on updating search criteria. If too many results, show dialog with tips, links to our knowledge base.
  • Gainsight PX again would provide your team with deep analytics around not only how many searches were conducted but how many return with low results, high results to inform your product team on how you may want to better design the search algorithm or expose filters better.

To be clear, custom events are not code-free and will require your developer to sprinkle the custom event javascript call from the various locations of your codebase that you'll want to send to PX.

Create Custom Events

Gainsight PX allows you to create custom events from the application by navigating to Administration > Events.

Assign the following statuses to the custom events to decide which events and properties can be dropped or retained to control the noise and volume of stored data:

  • Active: Gainsight PX stores data from this event.
  • Hidden: Gainsight PX stores data from the hidden event but this event is not visible on the platform.
  • Dropped: Gainsight PX does not store data from the dropped event. You can use this option for legacy events or for events from a third party application that need not be stored.


You can reconfigure the status and properties of existing events by using the new edit option in the list view of Custom Events.

edit event.jpg


Note: Custom events can also be created via API calls. For more information, refer to the Use Custom Event API article.

Global Context 

Global Context (previously known as Super Properties) gives product teams the ability to “set the stage” or "switch the set" for subsequent incoming events collected by the PX tag (page views, link clicks, button clicks).

Use Case 1

A Project Management tool is using PX to track data (Page views, Link clicks, and Button clicks). Users of the PM tool can log in and specify which project they are working on (Project A, Project B, and Project Z).

When the user chooses Project A, a Global Context call would be made to PX to say “OK, all events tracked from here on out, please associate with Project A”. Then, if user later switches to Project Z in the Project Management tool, the Global Context call would be made to PX to tell PX “OK, now any event you track from here on out, please associate with Project Z”.

This functionality has powerful benefits:

  • Allows your team to slice and dice (dimensionalize) any of the tracked events (i.e. pages, button clicks, link clicks) by the various Projects (A, B, Z) allowing for deeper analytics. How many times has someone used feature A when working on Project A vs. B, etc.
  • Eliminates duplicated data as the Project Name does not need to be included with every event.
  • Allows for more targeted engagements. For example, you can specify that an engagement launch for only those who viewed this page under Project Z (and not Project A or B).

Use Case 2

Let’s say your product targets multiple personas. For example, your product may have features that can be used by sales and marketing teams.

You can set the Global Context to be “Marketer” when a marketer logs in or “Sales” when sales logs in. Then, you can easily “slice/dice” or dimensionalize by the various Global Context values (How many marketers are using Feature A vs. How many from sales team are using that same Feature A).

Similar to custom events, making this call requires a developer to add the code to the various location of their code base that will determine when a context switch needs to occur.

  • Was this article helpful?