Welcome to the PartnerStack Integration Docs

Here you can find guides, documentation, support and FAQs to get you setup on PartnerStack.

Chat with us by clicking the message bubble in the bottom right if you are having any trouble!

Get Started

PartnerStackJS

PartnerstackJS is a JavaScript snippet that tracks the signups your partners have driven on your website.
The installation process should take 15-30 minutes, depending on your website and skill level.

Table of Contents

What is PartnerStackJS

PartnerstackJS is a JavaScript snippet that tracks the signups your partners have driven on your website (example.com in the illustration below).

It makes sure that when a customer goes through one of your Partners links and signs up, that they are attributed to your Partner. This means the Partner will earn rewards for that Customer's purchases.

Step 1. Install PartnerStackJS

It is required that you install PartnerStackJS across your entire site. This makes sure we can track sign ups in all browsers.

Copy PartnerStackJS from Integration Settings

Go to your integrations settings page in PartnerStack, and copy your Production PartnerStackJS snippet.

Paste into head of your page

Paste your entire PartnerStackJS snippet between the <head> tags of your website.

On some hosted sites (Webflow, or Wordpress for example) including the snippet can be done from settings, make sure you talk to whomever manages your site before installing. This type of installation is standard, they will know what to do.

👍

Check yourself

You can check you've installed PartnerStackJS correctly by opening your browser's Developer Console and typing growsumo.

If you have installed it correctly you will see an object returned. If you haven't it will return undefined.

Its a good idea to test a few pages to make sure it is available across the entire site.

Step 2. Track Signups

Now that PartnerStackJS is installed across your entire site, you can use it to track sign ups.

Missing signup points will result in missed tracking and unhappy partners.
Here are some common capture points to consider.

  • Signup/Registration Form
  • OAuth Signup
  • "Request a Demo" Form
  • "Contact Sales" Form

Each time a new user signs up for your website you'll assign their name, email, and customer_key to the growsumo object.

Here are the specific assignments:

  • growsumo.data.name={User_Name}
  • growsumo.data.email={User_Email}
  • growsumo.data.customer_key={unique_key_for_each_customer}

Once you have captured the information, you can then call growsumo.createSignup().

🚧

A note on Customer_Key

The customer_key is a unique string that identifies each customer you send to PartnerStack.
It must be non-changing, and of type String.

Ideally you can use an id or key that is already stored in your database to uniquely identify users.
(e.g.
your_users_id = "user_1z2y3wx5a6b7c";
growsumo.data.customer_key = your_users_id;
)

If you don't have a UserID to assign at the time of registration, it might make the most sense to use the User's Email as their customer_key.

(e.g.
your_users_email = "[email protected]";
growsumo.data.customer_key = your_users_email;
)

Please ensure that your customer_key has been passed through to growsumo.data.customer_key before you call growsumo.createSignup()

Example Code

This is just an example, you can use this as a starting point, but it will have to be modified for your site.

<!— Example signup form —>
<input id=‘name’ type=‘text’>
<input id=‘email’ type=‘text’>
<input id=“submit” type=“button” onclick=“signup()”>

<!— Example jQuery function that collects field values, 
assigning them to grosumo.data and calling createSignup() to create a customer on PartnerStack —>
<script>
function signup(){
  growsumo.data.name=$('#name').val();
  growsumo.data.email=$('#email').val();
  growsumo.data.customer_key=$('#id').val();
  growsumo.createSignup();
}
</script>

Once you've properly assigned the form data to growsumo.data. you can check for proper installation by opening your browser's Developer Console and typing growsumo.

See the example console below,

📘

Customer values will be cleared from the data when createSignup is called. This is done to ensure we dont get duplicate tracking requests for the same customer.

If you redirect to a new page on signup

If you redirect to a new page on signup you will want to use the createSignup callback function to make sure the request is completed before redirection

You can see a fully working solution here https://jsfiddle.net/xobc3cw5/

<script>
function handleSubmit(event) {
    // this prevents the form from submitting
    // until we are done calling out to growsumo and are ready to submit it
    event.preventDefault();
    growsumo.data.name=document.getElementById('signup-name').value;
    growsumo.data.email=document.getElementById('signup-email').value;
    growsumo.data.customer_key=document.getElementById('signup-id').value;
    growsumo.createSignup(function(){
          console.log('create signup was called successfully')
        // this is the callback function
        // it will be fired when the signup has been sent to growsumo
        // you will want to call submit in here
        document.getElementById('signup-form').submit();
    })
}
</script>

<form id="signup-form" 
    onsubmit="return handleSubmit(event);" 
    method="POST" action="https://example.com/signup">
        <input id="signup-name" type="text" value="">
        <input id="signup-email" type="text" value="">
        <input id="signup-id" type="text" value="" style="display:none">
        <button type="submit">Sign up</button>
</form>

Call a function immediately after PartnerStackJS has loaded

If you would like to call a function after the PartnerStackJS snippet has finished loading simply name the function growsumoInit()

<script>
    function growsumoInit() {
        alert('Snippet loaded');
    }
</script>

Step 3. Testing

Go to your Integrations Testing Suite.
Follow the on page guide for the Customer created test.
After you sign up, the Request Log will show any traffic being sent to your program.
Click "Test" when a successful signup event occurs.

Why isn't my test passing?

Tests will only pass once a properly formatted signup request is received.
Before contacting support, please ensure that:

  • You are opening the referral link in an incognito window.
  • You are assigning data to growsumo.data.<variable>
  • You are casting variables to Strings if needed
  • You are calling growsumo.createSignup()

Still having issues? Send us a note via intercom

Updated 9 months ago

PartnerStackJS


PartnerstackJS is a JavaScript snippet that tracks the signups your partners have driven on your website.
The installation process should take 15-30 minutes, depending on your website and skill level.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.