You are running campaigns through Upfluence and need to track sales generated on your e-commerce store? That's great! Our Upfluence tracking script has been made to track sales on any website. Before moving forward with this process, please make sure you are not a Shopify or WooCommerce user. If it's the case, please follow these guides.
In order for Upfluence to operate as expected, we must be able to capture your transactions. If you are not using a shopping cart platform that we already integrate with (Shopify and/or WooCommerce), you must implement our tracking solution on your website manually. Our tracking isn't very complicated and is installed similar to how Google Analytics is installed.
To install, you must complete the following steps.
Include a JavaScript code snippet on every page on your site so that we can track your affiliate visits.
Report each order to us either on your “thank you” page using JavaScript
NOTE: We highly recommend someone on your team with experience in HTML completes this setup. This setup requires scripts to be pasted into specific sections of your website’s HTML to work correctly. If you have any questions, please contact Upfluence support.
Generate your personal script link
From your integrations settings, scroll down until you see the tracking script section. Then, click on the “Generate script” button, this will open a dedicated modal
Enter the website on which the script will be installed. This will identify the site when you generate affiliate links later on. Press "Generate script" to create your own script.
Once done, we will provide you with two scripts that must be installed in two different places on your website.
NOTE: We advise you to copy these scripts in a notepad in the meantime because you will have to modify some values to match your website payload.
Installation
These two steps are mandatory to track sales.
1. Tracking Visits
Please copy/paste the first script code into the <body> section of every page of your website. Some CMS have dedicated sections in their settings to easily complete this manipulation.
2. Send orders
In order to track purchases, you need to also install the script on your “thank you” or order confirmation page. This would be the page that all customers are directed to after completing their order. This code is responsible for sending the order data to Upfluence.
a. Update the script payload
We recommend that you get help from a member of your technical team if needed.
Take the second generated script and update the payload to make sure it matches your website's payload, especially the one that corresponds to the order validation page.
When adding this code to your website you must dynamically insert the customer's transaction information from the respective order within the code snippet. As an example, "foo@bar.com" would be replaced with a real customer's email (e.g '{customerEmailAddress}' in the example below)
Below, we've provided a sample code snippet with dummy data that you can use as guide. Please use the one generated in Upfluence.
Not all data is required, but all is recommended. A description of each field is available at the end of this article.
Default Payload |
<script>_upf.push([ [ "order, { order_id: 1, // required order_name: "#1", // required amount: 105.45, // required currency: "USD", // required, items: [{name: 'product', amount: 105.45, currency: 'USD'}], customer: { customer_id: 1234, first_name: "foo", last_name: "bar", email: "foo@bar.com", }, } ])</script> |
Example script modified for Squarespace |
<script> _upf.push( ['order',{ 'order_id': {orderId}, // required 'order_name': '{orderId}', // required 'amount': {orderSubtotal}, // required 'currency': 'EUR', // required customer: { email: '{customerEmailAddress}', } }]);</script> |
b. Install the order tracking script
Please insert the following code and replace the values into the <body> section of your order confirmation / thank you page.
Once done, you're ready to send affiliate links to influencers and track sales in Upfluence!
NOTE: We highly recommend doing a test order with an affiliate link to make sure everything's has been properly configured before sending the links to influencers.
Variable Descriptions
Transaction Data
A transaction represents the entire order that occurred, and contains the following values:
Value | Type | Required | Description |
order_id | Number | Yes | Unique shopping cart order ID or transaction number used to reference the purchase that you're reporting. |
order_name | String | Yes | Can be the same value than order_id |
amount | Number | Yes | Total amount the customer was charged for the order. |
items | Number | No | Total number of items included in the order |
currency | String | Yes | The three letter currency code of the order totals that you are reporting. Example: USD, CAD, GBP. |
Customer Data
A customer represents the individual customer who purchased, and contains the following values:
Value | Type | Required | Description |
first_name | String | No | Customer first name |
last_name | String | No | Customer last name |
customer_id | Number | No | Customer ID |
String | No | Custom email address |
For further assistance, please feel free to contact us by clicking on the "Talk to a person" option within our chat feature. We're here to help!