Ingesting contextual data for targeting and analysis

Use case for ingesting contextual data

Pulse Insights can ingest contextual data about the current user, page, behavior, or device that isn’t immediately apparent or visible from the page they are visiting.

Contextual data is optional in most implementations, but is highly recommended because it can provide significant targeting flexibility, incremental insights, and enable appropriate follow-up with other systems.

Contextual data is used for two primary purposes:


Use the value of the contextual data to determine whether the user is eligible to see a survey.


You might pass Pulse Insights authentication status as contextual data so that you can target a survey to only actively authenticated users.


Learn how different values of the contextual data impact user responses.


You might pass Pulse Insights authentication status as contextual data so that you can learn if authenticated users answer differently than unauthenticated users.

Common data types to consider passing to Pulse Insights



• Session ID • User ID • Analytics IDs • Support Ticket ID

Often used to tie data to other systems to dig deeper or drive resolution. Note: Pulse Insights maintains a special field, client key, for a user identifier that persists for a user across devices.

Authentication status

• Unrecognized

• Recognized • Unauthenticated • Authenticated

User & enrollment details

• IsCustomer • Products owned • IsMFAEnabled • IsAutoPayEnrolled • IsPaperlessEnrolled • IsAlertsEnrolled • IsNewsletterEnrolled

Customer Tenure

• Join date

Model scores or output

• Likelihood to convert • Likelihood to cancel

• Segmentation scores • LLM prompt and output

Ecommerce details

• Cart amount • SKUs

Experience details

• IsWebview

Used if you'd like to target or view results of web users vs. app users [with webview screens].


• High Value Customer • Trade or business user

Locale details

• Market & Language

Used to serve the appropriate survey or language in global surveys.

Search/Filter usage

• Search term • Count of searches • Currently selected filters • Number of search results

Used to uncover the drivers of search satisfaction.

Categories or hierarchy

• Page category • Site section • Step number

A/B Test Variation

• Variation ID

Content details

• Author • Tags or topic

The Two Types of Contextual Data

Context Data

Describes the current page, survey, or person at the moment the survey is answered. The data may change from page to page and consequently these values don't persist from page to page.

Examples of good fit for contextual data:

  • Number of search results

  • Current search term

  • Current page hierarchy or category

  • Current step in a process

  • Current cart value

  • A/B Test Variation ID

  • Authentication Status

Device Data

Describes the device/browser (often as a proxy for the person). It is expected to remain relatively stable over time because it describes properties of the person/device.

Examples of good fit data for device data:

  • IsCustomer

  • JoinDate

The primary use case for Device Data is that it persists over multiple pageviews and visits and only needs to be defined once. For example, once you define a user as a customer once, you can use that targeting in subsequent pageviews and sessions without needing to redefine it.

Since device data is meant for data that changes infrequently, only the latest value is saved, not the value at the time the user responded. The latest device data values will apply to any and all responses from that user.

Syntax & Examples

Context Data – To Describe the Current Experience

pi('set_context_data', object);


pi('set_context_data', {author: 'Ann Smith', variant: 'a'});

If using Context Data for targeting, it should be defined before

pi('get', 'surveys');

since that line triggers the evaluation for whether to return a survey on the current pageview.

Device Data

pi('set_device_data', object);


pi('set_device_data', {userid: '1234', age: 32, locale: 'en-US'});

Contextual Data FAQs

When should I use Device Data vs. Context Data?

Context Data provides higher resolution in that it is stored with the impression and submission and thus is often the appropriate choice because it stores the values at the time the survey was submitted. Device data offers the capability to target across page views and sessions, so is beneficial for targeting, as long as the data remains stable over time.

Is context and device data available in exports?

Yes. Device and Context data have columns in the raw data exports.

Is context and device data available to integrations?

Yes. This includes both on-page JavaScript callbacks and API-based integrations.

How do I validate what context and device data Pulse Insights is getting?

You can view Context Data in the PulseInsightsObject. You can view Device Data in PulseInsightsObject and via network calls in your browser dev tools. See QA features for additional information.

How do I target surveys to specific values of device or context data?

See Targeting.

Last updated