Adding Affiliate Tracking & Conversion Codes

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000009295-adding-affiliate-tracking-conversion-codes

There are many 3rd party tools that require placing a tracking code on "success pages" in order to track sales, sign-ups, conversions, and more. 


With Brilliant Directories, it is possible to place tracking code widget for the "success pages" into each membership plan or in a specific widget that will apply to all membership plans. 


Membership Plans Method


There is a setting on each membership plan where the widget with the code can be placed. 


It can be found under Finance >> Membership Plans >> find the membership where the code needs to be added and click on Edit




Navigate to the "Sign-Ups & Upgrades" tab and scroll down to "Sign Ups / Upgrade Conversion Tracking Code" and select the preferred widget:




*This allows the activation of an additional Tracking Code Widget that will work alongside the default Bootstrap Theme - Conversion Tracking Codeswhich will always remain active.



Conversion Tracking Codes Widget and Available Variables to Utilize


Navigate Toolbox >> Widget Manager >> Bootstrap Theme - Conversion Tracking Codes




An example conversion tracking to add could look like the following:

fbq('track', 'Purchase', {currency: "AUD", value: <?php echo $conversion_tracking['amount']; ?>});


This code should be added below the following comment within this widget:




When adding this code, please make sure to wrap it around the <script> tag, as shown below:


<script type="text/javascript">fbq('track', 'Purchase', {currency: "AUD", value: <?php echo $conversion_tracking['amount']; ?>});</script>

The end result would look like the following:




Some common variables that affiliates and other trackers want to be included in the pixel tracking code are the order amount and order or member ID, etc. These are the variables available with Brilliant Directories:


COMMON VARIABLES AFFILIATE TRACKERS USE:


  • FIRST PAYMENT AMOUNT = <?php echo $conversion_tracking['amount']; ?>
  • RECURRING PAYMENT AMOUNT = <?php echo $conversion_tracking['recurring_amount']; ?>
  • ORDER ID / MEMBER ID = <?php echo $conversion_tracking['user_id']; ?>
  • COUPON CODE = <?php echo $conversion_tracking['coupon_code']; ?>
  • PRODUCT NAME = <?php echo $conversion_tracking['product_name']; ?>
  • PRODUCT TYPE = <?php echo $conversion_tracking['product_type']; ?> 
  • FREE TRIAL = <?php echo $conversion_tracking['free_trial']; ?>
  • FREE TRIAL DAYS = <?php echo $conversion_tracking['free_trial_period']; ?> 
  • FIRST BILL DATE = <?php echo $conversion_tracking['first_bill_date']; ?> 


ADVANCED VARIABLES AFFILIATE TRACKERS USE:


  • $conversion_tracking['invoice']['variable'];    (Invoice Variables from the tblinvoices table)
  • $conversion_tracking['product']['variable'];   (Member Subscription Variables from the tblhosting table)



IMPORTANT NOTE:  This widget is where the tracking code for affiliate programs, analytics, and more can be placed.

This widget only loads on pages after a member sign-ups or upgrades, to track successful sign-ups.