See Sprig in action! Join a group demo — every Tuesday @ 11:00 AM PT.
Register Here
navy logo
Products
PRODUCTS
survey icon
In-Product Surveys
Capture targeted user insights right in your product
replays icon
Replays
Recreate and optimize user journeys across your product
teal icon of a survey with chapters
Long-Form Surveys
Measure UX at scale with advanced link surveys and AI analysis.
heatmaps icon
Heatmaps
Visualize user behavior in your product at scale
feedback icon
Feedback
Collect continuous user feedback at scale
ai recommendations icon
AI Insights
NEW
Sprig AI generates actionable product solutions
Features
integrations
Integrations
mobile icon
Mobile
star icon
AI Analysis
magic pencil icon
AI Study Creator
dashboards icon
Dashboards
Solutions
by Use Case
continuously optimize icon
Continuously optimize
Analyze your users’ experience through core flows
solve pain points icon
Solve pain points
Uncover emerging trends in your users’ behavior
improve conversion icon
Improve conversion
Understand why and how users are dropping off
save time and resources icon
Save time & resources
Know which new features are worth the investment
by TEAM
uxr icon
User Research
Maximize the speed and impact of your research
Design
Validate and get buy-in for designs with real user insights
pm icon
Product Management
marketing
Marketing
code icon
Engineering
star icon
Customer Experience
Templates
lenny template
Survey
Develop Product Sense to Build Great Products
lenny headshot
Lenny Rachitsky
View Template
arrow icon
feedback template
Feedback
Continuously Collect Product Feedback
favicon
Sprig
View Template
arrow icon
Optimize New Features
Replay
Optimize New Features to Enhance the User Experience
favicon
Sprig
View Template
arrow icon
templates
Template Gallery
Discover how our team and community use Sprig templates to inform product development.
View All
arrow icon
Customers
square nav photosquare left logo
Square uncovered 100+ actionable insights within the first 6 months
Read Now
arrow icon
ramp nav imageramp logo
Ramp created customer-centric products with Sprig AI
Read Now
arrow icon
classpass nav photoclasspass left logo
ClassPass improved usability and retention by optimizing core user journeys
Read Now
arrow icon
users icon
Meet our Customers
Learn how top companies leverage Sprig user insights to boost conversion, reduce churn, improve onboarding, and more.
View All
arrow icon
Resources
blog icon
Blog
Get expert advice on capturing product experience insights
event icon
Events & Webinars
Learn from past Sprig events & register for upcoming ones
help center icon
Help Center
Explore our knowledge hub to get started
in Sprig
video tutorial icon
Video Tutorials
Get a crash course in Sprig with our guided
video series
AI replay announcement text with a dashboard showing AI insights
New: AI-Powered Always-On Replays
Read Now
arrow icon
EnterprisePricing
Sign In
Book a Demo
navy logo
hamburger menu iconclose icon
Products
caret icon
Products
survey icon
In-Product Surveys
teal icon of a survey with chapters
Long-Form Surveys
feedback icon
Feedback
replays icon
Replays
heatmaps icon
Heatmaps
ai recommendations icon
AI Insights
Features
integrations
Integrations
mobile icon
Mobile
star icon
AI Analysis
magic pencil icon
AI Study Creator
dashboards icon
Dashboards
Solutions
caret icon
By Use case
continuously optimize icon
Continuously optimize your product & website
solve pain points icon
Surface & solve pain points
improve conversion icon
Improve conversion rates
save time and resources icon
Save engineering time & resources
By TEAM
uxr icon
User Research
Design
pm icon
Product Management
marketing
Marketing
code icon
Engineering
star icon
Customer Experience
Templates
Customers
Resources
caret icon
blog icon
Blog
event icon
Events & Webinars
help center icon
Help Center
video tutorial icon
Video Tutorials
Enterprise
Pricing
Sign InGet Started Free
VIDEO TUTORIAL

How to Add Events and Attributes in Sprig

Hello! Welcome to our guide to adding Events and Attributes to Sprig.

Events and Attributes are two key pieces of information that you can use to create a run targeted in-product studies in Sprig. Events determine when a study should appear (such as when a user visits a particular page in your product), while Attributes define who is eligible to see a study based on certain user characteristics (such as their plan type or country). Events and Attributes are essential to launching Sprig studies in your web or mobile product, but they are not needed for Shareable Link studies.

Before you can start adding Events and Attributes, you need to install the Sprig SDK. There are three main installation methods, Segment, Google Tag Manager and Javascript. Feel free to refer to those tutorials for more details around installation.

Let’s start with Events. With each of these installation methods, you have the option of adding No-Code Events directly in the Sprig app. No Code Events can be created to trigger basic Events like those based on a URL, Inner Text Match or CSS selector. For more complex Event types, you will need to build a Code Event to trigger the study, which we’ll walk through shortly.

When Sprig receives an Event, the study is displayed if the user is eligible to receive that study. You can see the overall user traffic here in the “Activity” column.

Let’s move onto Attributes, which you can send to Sprig for additional targeting capabilities. If using Segment or Google Tag Manager, Attributes can be passed along to Sprig through some simple configuration decisions that we’ll review in just a moment. If you are installing Sprig through the Javascript snippet, you’ll need to manually set desired Attributes for your users.

Segment

First, we’ll walk through how to add Events and Attributes with Segment. Let’s navigate to our Integrations page and select Segment.

If you installed Sprig with Segment, you likely already have Events sending from Segment to Sprig. By default, the installation will automatically enable sending Identify, Alias, Track and Sign out triggers that are already built in your Segment source. In addition, with the default installation, user traits from Segment will also be passed along to Sprig in the form of Attributes.

Google Tag Manager

For Google Tag Manager, there are three main steps you’ll need to take to generate triggers that can be used by Sprig to display a study:

  1. Create and configure the Trigger as a Variable in GTM.
  2. Create the Sprig Tag and associate the Trigger to the Tag.
  3. Publish your changes to the server.

Let’s walk through these 3 steps with an example. Let’s say you want to display a study when users click a button labeled CONTACT on a specific web page. This example will use the GTM built-in variable Click Text for targeting the button label in the CSS of a page.

  1. In the Google Tag Manager app, click Variables.
  2. In Built-in Variables, click Configure.
  3. Click on the Variables you want to enable. In this example, we will use Click Text.
  4. Now click on Triggers to create a trigger using the Click Text variable.
  5. Click New.
  6. Click Untitled Trigger and give the trigger an appropriate name, for example, Contact Button Click.
  7. In Trigger Configuration, click or to choose the trigger type.
  8. Select Click - All Elements as the trigger type.
  9. Now click Some Clicks.
  10. In the first item list, make sure Click Text is selected.
  11. In the second item list, make sure contains is selected.
  12. In the text box, type in the button label; in this example, CONTACT.
  13. Click Save.

Since the Sprig Tag has already been installed you will need to add this new Trigger under the Tag. If you have not already installed GTM reference install walkthrough video.

  1. Select your “Sprig Install Tag”
  2. In Triggering, click or
  3. Click on the + Button
  4. Select Contact Button Click as the trigger.
  5. Click Save.
  6. Click Submit and then Publish to push your changes out to the server.
  7. Test the trigger by clicking the button and navigating to the Events page in the Sprig app. You may have to click Browser Reload to refresh the Events page contents.

In addition to Events, you can also send Google Tag Manager’s user-defined variables through to Sprig, where they can be used as Attributes. Let’s demo that process:

  1. In the Google Tag Manager app, click Variables.
  2. In User-Defined Variables, click New.
  3. Click Untitled Variable and give the variable an appropriate name, for example, Get Day.
  4. In Variable Configuration, click or to choose the variable type.
  5. Select Custom Java Script as the variable type.
  6. Paste in the following JavaScript in the field and click Save.

Javascript

Last, but not least, let’s walk through the process of adding Events and Attributes with Sprig’s Javascript SDK. For a standard Javascript SDK installation, you will want to use the Sprig.track method for creating a Code-based Event.

To add or track a Code Event for triggering or filtering, you will need a specific snippet, which you can find in the Javascript card in the Sprig Integrations Gallery.

After sending a new Code event to Sprig, you must approve the new event request on the Events page before it can be used to trigger or filter surveys. Be sure that the Event name used in Sprig is identical to the name used in your snippet. You can also optionally add properties to your Event.

Let’s switch gears to sending Attributes with the Javascript SDK. With the Javascript installation method, the Sprig SDK automatically tracks default Attributes including Browser and version, Device, Session count, and Page URL. In order to create additional custom Attributes on a visitor, you will want to employ the Sprig set Attribute methods. The set Attribute methods for both HTML script and NPM installation.

And you're done!

That wraps up our overview of creating Events and Attributes in Sprig across Segment, Google Tag Manager, and Javascript! If you have any more questions about the process, head over to Sprig’s documentation at docs.sprig.com.

Unlock your product’s full potential

Get Started Free
white sprig logo
Products
In-Product Surveys
Long-Form Surveys
Feedback
Replays
Heatmaps
AI Insights
Features
Integrations
Mobile
AI Study Creator
Dashboards
AI Analysis
Security Standards
Solutions
BY use case
Continuously Optimize
Improve Conversion
Solve Pain Points
Save Time & Resources
BY TEAM
User Research
Design
Product Management
Marketing
Engineering
Customer Experience
Templates
Customers
Resources
Blog
Events & Webinars
Help Center
Video Tutorials
Session Replay Guide
Pricing
Enterprise
Company
About Us
Careers
Sprig Service Agreement
Privacy Policy
Data Processing Addendum
Status
Compare
vs Qualtrics
vs Fullstory
vs Hotjar
vs Medallia
vs Pendo
Copyright 2025 Sprig, All Rights Reserved
linedkin logotwitter logo