๐ŸŽ‰ 1Flow is proudly backed by Y Combinator.
logo

Get Started

You can embed our Javascript SDK into any website or web application. This include (but not limited to):
โœ…ย HTML
โœ…ย Google Tag Manager
โœ…ย Webflow
โœ…ย React
โœ…ย Angular
โœ…ย Vue.js
โœ…ย Next.js
โœ…ย React Expo (Web)
โœ…ย Gasby
Not sure if your project is supported? Contact us to find out.

1. Embed our script

Copy and paste the below code snippet inside the header (<head>) section of your site. Place the tracking script between theย <head> โ€ฆ </head>ย tags.
javascript
<!-- 1Flow Tracking Script --> <script> const apiKey = 'your-project-api-key'; // TODO: replace this with your api key (function(w,o,s,t,k,a,r){ w._1flow= function (e,d,v){ s(function(){w._1flow(e,d,(!v)?{}:v)},500)}, a=o.getElementsByTagName('head')[0]; r=o.createElement('script');r.async=1; r.setAttribute('data-api-key',k) r.src=t; a.appendChild(r); })(window,document,setTimeout,'https://1flow.app/js/1flow.js', apiKey); </script> <!-- End of 1Flow Tracking Script -->
๐Ÿ’ก
Note: you need to replace 'your-project-api-key' with your actual project API key. Click here and navigate to Project Settings โ†’ API keys section.
Not sure where to put this script? Check out our special instructions.

2. Identify users

๐Ÿ’ก
This step is optional - only needed if you want to know the user identity, or refine targeting based on certain traits.
For logged in users, you can send us any traits about the user (such as their name, email, company, role, language, ...). This way, youโ€™ll be able to see who sent the feedback, and refine your target audience for each survey based on the user traits and events.
Whenever the user has signed in, you can make an identify call to send us the user id, along with any traits.
javascript
<script> window._1flow('identify', userId, { 'name': 'Jane Doe', 'company': 'ACME, Inc.' 'email': 'jane.doe@gmail.com', 'plan': 'Premium' 'total_spend': 880 }); </script>
We recommend that you make an identify call on every new session to ensure data is up-to-date.

3. Track events

๐Ÿ’ก
This step is optional - you can always use page URL rules to trigger events (no-code required).
If you want to control more precisely when a survey should show up, or track events completed by each user in order to refine target audience, then you can send us events data using the track call.
javascript
<script> window._1flow('track', 'event name', { 'record_id':'1234abcdef56', 'quantity': 1 }); </script>

Example usage

Show your first survey

Now that you've successfully integrated 1Flow into your SDK, it's time to create your first survey.
If you've already created a survey and published it (survey shows up in the "In Progress" section of the dashboard), run the app and trigger the event to happen, you should see the survey show up when the event is fired.

Helpful?