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

GrowSumoJS

Overview

GrowSumoJS is javascript snippet that reads browser cookies and sends signup information back to your GrowSumo account.
This process should take about 30 minutes, but may vary depending on your application, tech stack, and skill level.

In this Guide:

Step 1. Identify Landing Pages & Capture Points

It is critical to identify all of the paths a visitor may take to becoming your customer. You'll want to connect GrowSumoJS to as many of these paths as possible.

Missing critical signup flows will result in missed tracking and unhappy partners.
For example, connecting GrowSumoJS to your signup page but not your demo request form, would stop you from crediting partners for referral demos that convert into paying accounts.

Here are some common capture points:

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

Step 2. Install GrowSumoJS

With your capture points identified, you'll install GrowSumoJS on those pages.

Copy GrowSumoJS from Integration Settings

Go to your integrations settings page in GrowSumo, and copy your Production GrowSumoJS snippet.

Paste into Header of your page

Paste your entire GrowSumoJS snippet between the <Head> tags of every capture point page.

When you've properly installed GrowsumoJS, the growsumo javascript object will be defined.
You can check for proper installation by opening your Browsers Developer Tools > Console and typing growsumo.

Step 3. Connect form data to GrowSumo Object

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

Here are the specific assignments:

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

A note on Customer_Key

The customer_key is a unique string that identifies each customer you send to growsumo.
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 = "newuser@example.com";
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 an example, you cannot just copy & paste this into your website.

<!— 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 GrowSumo.data and calling createSignup() to create a customer on GrowSumo —>
<script>
function signup(){
  growsumo.data.name=$.('#name');
  growsumo.data.email=$.('#email');
  growsumo.data.customer_key=$.('#id');
  growsumo.createSignup();
}
</script>

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

See the example console below,

NOTE* Some values within growsumo.data will be cleared from the object after createSignup() is called.

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 GrowSumoJS has loaded

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

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

Step 4. 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

GrowSumoJS


Suggested Edits are limited on API Reference Pages

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