Sign-up Tracking

This guide explains how to use Partnero to capture customer sign-ups whenever referred visitors sign up for your product on your website.

It showcases several options for capturing these sign-ups.

Please note that before you begin, your website should already have the Partnero Universal / PartneroJS snippet installed. Additionally, the website and sign-up form must be on the same domain.

When sending customer sign-up events to Partnero, the following customer details are required:

  • Name: the name of the customer (optional)
  • Email: the email address of the customer
  • Customer Key: The main identification of the customer. Can be anything, but we recommend using an account ID or customer's email address.

When you use the Partnero Universal / PartneroJS snippet with the examples below, customers referred by partners are automatically identified, ensuring that each customer is assigned to the correct partner. This occurs when their data matches the information stored in the partnero_partner or partnero_referral (Refer-a-friend program) cookies, or the URL’s query parameter (if the unique partner key is present). Therefore, there is no need to manually pass the partner key.

Partnero Universal sign-up tracking

Partnero Universal provides a universal method to capture sign-ups from forms that use the form.submit event. This is the simplest no-code solution to capture sign-ups without additional coding. Please note that more advanced forms may require more advanced integration options.

This integration detects form submissions and creates a customer in your Partnero account using the data (name and email address) submitted via the form.

Include this sign-up tracking snippet at the bottom of the page on your website where sign-ups are captured.

<script>
    po('integration', 'universal', null);
</script>

Partnero JavaScript sign-up tracking

JavaScript sign-up tracking method is more advanced and customizable.

Using this method, you need to set the values to represent the customer’s details.

Immediately after a user successfully signs up, run this script with the required values to ensure proper tracking.

<script>
    po('customers',
        'signup', {
            data: {
                key: 'customer_123456', // or email address
                name: 'John',
                email: 'john.doe@partnero.com'
            }
        }
    );
</script>
<script>
    po('customers',
        'signup', {
            data: {
                key: 'customer_123456', // or email address
                name: 'John',
                email: 'john.doe@partnero.com',
                partner: {
                    key: '{UNIQUE_PARTNER_KEY}'
                }
            }
        }
    );
</script>

Implementation example

In the example below, you’ll see how customer details can be populated from the sign-up form.

Example of HTML signup form

<html>
<head>
    <title>Partnero Example</title>
    <!-- Partnero Universal -->
    <script>
        (function(p,t,n,e,r,o){ p['__partnerObject']=r;function f(){
            var c={ a:arguments,q:[]};var r=this.push(c);return "number"!=typeof r?r:f.bind(c.q);}
            f.q=f.q||[];p[r]=p[r]||f.bind(f.q);p[r].q=p[r].q||f.q;o=t.createElement(n);
            var _=t.getElementsByTagName(n)[0];o.async=1;o.src=e+'?v'+(~~(new Date().getTime()/1e6));
            _.parentNode.insertBefore(o,_);})(window, document, 'script', 'https://app.partnero.com/js/universal.js', 'po');
        po('settings', 'assets_host', 'https://assets.partnero.com');
        po('program', 'PUBLIC_PROGRAM_ID', 'load');
    </script>
    <!-- End Partnero Universal -->
</head>
<body>

<form id="form-example">
    <label for="name">Your name</label>
    <input id="name" type="text" name="name" />
    <label for="email">Your email:</label>
    <input id="email" type="email" name="email" />
    <label for="password">Password:</label>
    <input id="password" type="password" name="password" required>

    <input type="submit" id="submit-button" value="Submit" />
</form>

</body>
</html>

JavaScript example

This example demonstrates an updated JavaScript sign-up tracking method that populates data from the HTML example provided above.

<script>
    document.addEventListener('DOMContentLoaded', function () {
        const form = document.getElementById('form-example');
        if (form) {
            form.addEventListener('submit', function (event) {
                event.preventDefault();
                const name = form.querySelector('input[name="name"]').value;
                const email = form.querySelector('input[name="email"]').value;
                if (email) {
                    po('customers', 'signup', {
                        data: {
                            key: email,
                            name: name,
                            email: email
                        }
                    });
                }
            });
        }
    });
</script>

Partnero API sign-up tracking

Partnero API is built with RESTful principles and provides the most flexible and robust option to send customer details to Partnero via secure API calls. For more details, you can read the reference documentation.

To send customer details to your Partnero account, the Customer create method needs to be called:

POST https://api.partnero.com/v1/customers

Request example

{
    "partner": {
        "key": "UNIQUE_PARTNER_KEY"
    },
    "key": "CUSTOMER_KEY",
    "email": "customer@partnero.com",
    "name": "Partnero"
}
curl --location --request POST 'https://api.partnero.com/v1/customers' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"partner": {
    "key": "UNIQUE_PARTNER_KEY"
},
"key": "CUSTOMER_KEY",
"email": "customer@partnero.com",
"name": "Partnero"
}'

Request parameters

ParametersTypeRequiredDetails
keystringyesThe main identification of the customer. Can be anything, but we recommend using an account ID or customer's email address. This will be required when creating transactions for the customer.
emailstringoptionalMust be a unique email address.
namestringoptionalA name for the customer.
partnerobject[]yesPartner data.
partner.keystringyesMust provide the partner's key to whom you are willing to create a customer. Should be populated with *UNIQUE_PARTNER_KEY.
partner.idstringoptionalAlternatively, Partner ID can be used instead of key.
partner.emailstringoptionalAlternatively, Partner email address can be used instead of key.
additionalobject[]optionalAdditional parameters.
additional.referral_urlstringoptionalOption to pass an additional **referral URL to identify signups from different URLs when multi-links are used.

*You have to populate partner.key data object with UNIQUE_PARTNER_KEY, which is saved in partnero_partner (or partnero_referral) cookie created by Partnero Universal / PartneroJS snippet or can be identified from the URL.

**The URL must be an unique referral URL which was asisgbed to a partner.