Who is this article for?
This article will be useful to you if are a company on PartnerStack looking for a high-level overview of integrations.
In-depth technical details can be found in our developer docs at docs.partnerstack.com.
Connecting PartnerStack to your web application
The power of using PartnerStack comes from automatically tracking program activity and issuing commissions to your partners. A proper integration keeps your tracking accurate, your payouts on time, and your partners happy to promote your company.
There are two parts to integrating with PartnerStack:
- Tracking Referred Signups
- Triggering a commission
1. Tracking Referred Signups
The start of every integration with PartnerStack is also the most important step. This is the connection between a partner (referrer) and your new user (referee). This relationship is contained within a customer in PartnerStack.
Each partner (reseller, affiliate, etc.) has a partner_key
which is used to tag traffic coming through a referral link to land on your website.
When a user clicks on a link, PartnerStack sets a cookie
called growSumoPartnerKey
on the user's browser. The value of this cookie is the partner's unique partner key
.
Using GrowSumoJS
GrowSumoJS is a small multi-purpose javascript snippet that can be inserted into the header of your web page.
The snippet provides the following functionalities:
- initializes a GrowSumo object on the front-end of your website
- provides a function to track signups (growsumo.createdSignup)
- retrieves the value of the
growSumoPartnerKey
cookie, making it accessible asgrowsumo.data.partner_key
.
Creating a customer
A customer in PartnerStack is a referred user who has signed up to your website.
Each customer has a:
- partner_key - that identifies who referred them
- customer_key - that uniquely identifies the customer. Either a unique string/number or email address.
- name - The customer's name
- email address - The customer's email
Whether you use GrowSumoJS standalone, or in conjunction with the GrowSumo API, you must create a customer to represent a referred sign up BEFORE triggering any commissions. All commissions are connected to a customer.
2. Triggering a commission
Now that you've created a Customer it's time to trigger a commission for the partner.
PartnerStack handles the logic and payout of your commissions, all you need to do is provide some information about the event when it occurs.
Example commission offers:
- Percentage (%) of each sale made
- Flat amount ($) after a sales volume is reached
- Percentage (%) of the first sale, and flat amount for every 5 sales after.
- Flat amount ($) for a signup
- Flat amount ($) for a website review, social media share, or eBook Download
Informing PartnerStack a commissionable event has occurred
Step one is to set up some triggers in your PartnerStack account, this will tell PartnerStack what events to listen for, and what actions to carry out when they are detected. You can learn more about setting up these triggers here.
Once a trigger is set up it will activate based on the info you send to the PartnerStack API. Most commonly triggers will activate on a transaction event.
The transaction API call has two key elements:
- customer_key (required) - to identify which customer in PartnerStack and there-by attribute the commission to the correct partner
- product_key (optional) - links the request to the proper commission logic in PartnerStack
Example:product_key
= "eBook" triggers a $1 commission for an eBook download.product_key
= "premium" triggers a 25% commission of the purchased amount.