Many third-party tools require a tracking code on "success pages" to track sales, sign-ups, conversions and more.


With Brilliant Directories, tracking code for the success pages can be placed in a widget selected on each membership plan, or in one widget that applies to all membership plans.


Membership Plans Method


Each membership plan has a setting where a widget with the tracking code can be selected.


  1. Navigate to Finance > Membership Plans, find the plan where the code needs to be added and click Edit.

    The Membership Plans page with Finance > Membership Plans highlighted in the menu and the Edit button highlighted on the Featured plan.

  2. On the Sign Ups & Upgrades tab, scroll down to Successful Sign Up / Upgrade Conversion Tracking Code Widget and select the preferred widget. Only custom widgets are listed.

    A membership plan's Sign Ups & Upgrades tab with the Successful Sign Up / Upgrade Conversion Tracking Code Widget dropdown highlighted.

  3. Click Save Changes.


The selected widget works alongside the default Bootstrap Theme - Conversion Tracking Codes widget, which always remains active.


Conversion Tracking Codes Widget and Available Variables


Navigate to Toolbox > Widget Manager, search for Conversion Tracking Codes and click Customize on Bootstrap Theme - Conversion Tracking Codes. Saving the widget creates a customized copy of it for the website.


An example conversion tracking code could look like the following:

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


Add the code below this comment in the widget (line 38):


The Conversion Tracking Codes widget code with line 38, the 'Enter Conversion Tracking Codes' comment, highlighted as the place to add tracking code.


Wrap JavaScript code in a <script> tag, as shown below:

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


The end result looks like the following:


The widget code with a Meta Pixel Purchase script added on line 40, below the line 38 comment, highlighted.


Affiliate programs and other trackers often need the order amount, the order or member ID and similar details in the tracking code. These variables are available:


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)


The widget code with the common and advanced conversion tracking variables (lines 21 to 36) highlighted.


IMPORTANT NOTE: This widget is where the tracking code for affiliate programs, analytics and more can be placed. It only loads after a member signs up or upgrades, to track successful sign-ups.


Paid sign-ups with a Stripe card form.
When a paid sign-up is completed through the Stripe card form, the success message appears in a pop-up on the checkout page. Script tracking codes in this widget (for example a Meta Pixel fbq('track', 'Purchase') call), not only image pixels, run once when that pop-up appears. Scripts run in the order they appear, and an external library tag is loaded before the inline code that follows it. Other payment gateways already ran these scripts, and a declined card runs nothing.


Alternative Method: Adding Conversion Tracking to Pop-Up Success Messages


When a conversion action does not load a separate success page (for example, a pop-up message confirms success on the same page), the conversion tracking code can be placed in the text label shown after the successful action.


This example adds a Google Ads conversion tracking code to the newsletter sign-up pop-up.


  1. Navigate to Toolbox > Widget Manager and click New Widget.

    Widget Manager with the New Widget button highlighted.

  2. Name the widget, add the tracking code in the HTML tab and save the widget. The saved widget looks like this:

    A new widget named Conversion Tracking 1 with a sample Google Ads gtag conversion script in its HTML tab, both highlighted.

  3. Click Shortcode and choose PHP Shortcode.

    The widget editor's Shortcode menu open with the PHP Shortcode option highlighted.

  4. Navigate to Settings > Text Labels, search for the label of the success message (here thanks_joining_newsletter), paste the shortcode after the message text and click Save.


The code can also be pasted directly into the text label instead of a widget shortcode. The widget method is recommended for more reliable performance and smoother processing.


The tracking code now runs each time a visitor subscribes to the newsletter.


The newsletter success pop-up with Chrome DevTools open below it, highlighting the conversion tracking script inside the success message.


This option is useful wherever the confirmation appears as inline text or a pop-up rather than a new page.


NOTE: This method may not work reliably when the script requires a specific loading sequence or is complex. Test thoroughly before finalizing any updates.