Track Transaction

ReferralHero provides the ability to track ongoing transactions, allowing you to reward affiliates not just for the initial transaction but for subsequent transactions as well. This is particularly useful for businesses that want to offer commissions for recurring purchases, upgrades, or any other form of ongoing customer engagement.

Why Track Ongoing Transactions?

  • Maximize Affiliate Engagement: By rewarding affiliates for ongoing transactions, you incentivize them to drive not just sign-ups but also long-term, high-value customers.

  • Encourage Customer Retention: Affiliates are more likely to promote your brand if they know they can earn commissions on recurring purchases, leading to better customer retention.

How Does It Work?

To track ongoing transactions, you pass transaction data to ReferralHero using the method mentioned below. This method records details about each transaction, such as the transaction amount, product ID, and customer email. By doing so, ReferralHero can attribute these transactions to the appropriate affiliate and calculate commissions accordingly.

RH_MFxxxxxxxxxx.trackTransaction(data);

Example: Tracking a Transaction

This example dynamically collects transaction details from a form and then tracks the transaction when the form is submitted.

<script>
  window.RHConfig = {
    callbacks: {
      ready: function() {
        var form = document.getElementById('transaction-form');

        form.addEventListener('submit', function(e) {

          // Get the data from form inputs
          var data = {
            amount: form.querySelector('#amount').value,
            product_id: form.querySelector('#product_id').value,
            email: form.querySelector('#email').value,
            transaction_id: form.querySelector('#transaction_id').value,
            lifetime_spend: form.querySelector('#lifetime_spend').value
          };
          
          // Check if the ReferralHero instance is available and track the transaction
          if (RH_MFxxxxxxxxx) {
            RH_MFxxxxxxxxxxx.trackTransaction(data);
          }
        });
      }
    }
  };
</script>

Replace the MFxxxxxxxxxx with your specific campaign UUID.

To verify that the transaction tracking is working correctly, you can follow these steps:

  1. Navigate to the Main Page: Start by logging into your ReferralHero account and navigating to the main dashboard.

  2. Access Reward Logs: Once on the main dashboard, go to the "Reward Logs" section in sidebar. This is where all tracked transactions and rewards are recorded.

  3. View Transactions: Within the "Reward Logs" section, find the "Transaction" sub-section. This will display all the transactions that have been tracked by ReferralHero.

  4. Check for Latest Transaction: Look through the list of transactions to find the most recent one. Verify that the details (e.g., amount, product ID, customer email) match the data you passed in your transaction tracking script.

If the latest transaction is listed with the correct details, it confirms that the transaction tracking is functioning as expected. If it's not there, double-check the implementation of your tracking script to ensure that all required data is being correctly captured and passed to ReferralHero.

Last updated