We have created personalized guides to integrate with the following apps:
React/Nextjs, Framer,
Webflow, Wordpress,
Gumroad.
Step One: Copy Embeded Code
Client Side Implementation
Insert our script tag in your website’s head tag. $1Price to your window object which will categorize new users.
Server Side Implementation
Fetching the 1Price Object Each time you have a new visitor, you must fetch the 1Price object and store it. We recommend storing it in a cookie for three hours.The country code of the user
The origin of the request
The customer linked to the offer
The offer shown for experiments
The experiment linked to the offer
Step Two: Dynamic Price Number
To have adaptive pricing, change the price value to correspond with the 1Price Experiment. This value will be used during pricing tables within the app and landing page.POST
Success Status
Currency
Product Details
Use this data to dynamically populate your pricing table and ensure your visitors always see the most up-to-date pricing information.
$1Price Parameters:
The workspace of your account
The customer linked to the offer
The experiment linked to the offer
The offer shown for experiments
Optional parameter to specify the currency for returned pricing values (e.g.,
“usd”, “eur”, “gbp”)
Additional parameters include:
Optional parameter to maintain consistent pricing for a specific customer
across multiple sessions
Sample Response
Sample Response
Step Three: Track Purchases
To determine the success of a experiment, we track multiple data points on Results. Simply add aoneprice_cid to your Stripe Checkout Session
You’ll need to send the 1Price generated priceId to your backend server when creating a Stripe subscription.
Example above is with Javascript, but it is the same with every language. You
just need to send the oneprice_cid from client side to your backend server either
with params, query, or body and then send it to Stripe with metadata when a
stripe checkout session.Also note, we can only track Checkout Sessions at the moment. Subscription Creations is in beta. Message us for access
Handling Subscription Upgrades
We recommend having your own billing pages given the structure of price experiments. However, for customers who use the Stripe billing portal, our beta/v3/price_value endpoint contains a stripeCheckoutSubscriptionUpdate property.
To retrieve this property simply follow the Step 2 and access the stripeCheckoutSubscriptionUpdate property.
When creating your Stripe portal sessions you will first need to create a custom session. The following is an example of how to create a custom session using the NodeJS library.
🧪 Test Integration:
- Start an experiment on 1Price
- Make a test purchase on your website/app
- Ensure transaction was tracked on dashboard
BONUS: You can create a 100% off coupon on Stripe and use that code to make the test purchase, so you do not get charged.
FAQs
Why do get the error: ‘Start an experiment to activate script’? This error appears when there are no active experiments in your workspace. To resolve this, go to your dashboard and set at least one experiment’s status toIn Progress. The script will automatically activate once you have an active experiment.
What’s the difference between data-1p and workspace_id?
These are two references to the same identifier. data-1p is used when embedding the script tag, while workspace_id is used when accessing it programmatically through $1Price.workspace_id. Both contain the same unique workspace identifier.
Do I need to specify the uniqueId and currency?
The uniqueId parameter is optional and can be used to maintain consistent pricing for a specific customer across multiple sessions. The currency parameter is also optional and can be used to specify the currency for returned pricing values.
How can I preview what a specific customer segment sees?
You can preview the pricing for any offer by making a GET request to: