Skip to main content
Upfluence subscriptions tracking (AST) - Recharge

Learn how to track Recharge subscriptions from Upfluence

Updated over 6 months ago

Upfluence allows any user to track subscriptions made on their site and run affiliate marketing campaigns. Thanks to this, you can easily collaborate with influencers and pay them depending on the sales generated.

In this guide, together, we will install the sales tracking system with Recharge (Shopify App). Also, this installation also works to track regular Shopify sales.

Important: If you only want to track the sales and not subscriptions, we highly suggest installing our native Shopify integration.

πŸ”— 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 and the ecommerce platform 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:

  • Please, keep this page open. You'll need to copy/paste the first script on Shopify to configure sales tracking.

  • In this tutorial, we will provide you the second script with the replaced value for Recharge

😎 Installation

1. Install the first script

The first script allows you to efficiently identify users who click on it and subsequently attribute sales.

The first script is installed in the <head> of all your pages. To do this, we'll need to edit your Shopify's "theme.liquid" file.

  1. Login into your Shopify store

  2. Go to "Themes" then click on "..." and finally "Edit code".

3. Find the "theme.liquid" page, just scroll down when you see <!-- Scripts --> in the code

4. Paste your first script obtained when creating your dedicated script in Upfluence

Note

If you already have scripts installed, then paste the copied script after the last </script> tag that appears.

Perfect, you are done with the first script, let's install the second one!

2. Install the second script

The second script will enable you to track the subscriptions with Recharge.

  • Login into your Shopify store

  • Access your Shopify settings

  • Access "Checkout" settings

  • Scroll down until you see the "Order status page" section. We will now paste the required scripts to track the subscriptions. We will need to paste two scripts.

  • Paste the first script generated in Upfluence and remove the {{!-- Upfluence Tracking Script --}} part. This must be pasted in the "Additional scripts" text area.

  • This script needs to be pasted again because the theme.liquid script does not apply on this page.

  • If you already have scripts installed, then paste the copied script after the last </script> tag that appears.

  • Copy the following script and paste it after the first script (after the </script> tag)

<script>
_upf.push(
[
'order',
{
order_id: '{{order_number}}', // required
order_name: '{{order_number}}', // required
amount: {{subtotal_price | times: 0.01}}, // required
currency: '{{currency}}', // required,
items: [{% for line_item in order.line_items %}
{
name: '{{ line_item.title }}',
amount: {{ line_item.line_price | times: 0.01 }},
currency: '{{currency}}'
},
{% endfor %}],
customer: {
customer_id: {{customer.id}},
first_name: '{{customer.first_name}}',
last_name: '{{customer.last_name}}',
email: '{{customer.email}}',
}
}
]
)
</script>

You should now have two scripts:

  1. The first one (same as the one in step 1)

  2. The second one provided above

  • Save to confirm

πŸŽ‰πŸŽ‰πŸŽ‰ The installation is now complete. Please follow this guide if you want to learn how to generate affiliate links and send them to influencers: Workflow: How to add discount codes or affiliate links


πŸ€” FAQ

Does this system track recurring subscriptions?

No, this integration only tracks the first subscription.

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!

Did this answer your question?