Signup and Purchase Tracking

Available in the Custom Code Section under Website Builder, there are these two options called Sign up Tracking & Purchase Tracking Code. These two will empower you to enable better tracking of events such as sign-ups and conversions from your paid promotions on Google, Facebook channels and boost your marketing strategies. 

Note: This option is for more advanced Facebook ad platform users and hence please use this option with caution. 

To get the signup or purchase tracking code from Facebook, follow the steps here: About Facebook Pixel Standard and custom events

Below, we’ve included some useful info on how tracking code works on Knorish and the variables you can use for better tracking purposes.

Note: While copying and editing this code, please ensure to copy the same without altering the actual code. Only the values must be changed else the event would not fire properly.

Sign up Tracking Code 


Website Builder > Custom Code > Sign Up Tracking Code
allows you to track all new signups on your Knorish site. Simply copy the code received from the ad platform and paste the code here. 

sign up tracking code knorish

You can also add the below listed Liquid variables to push data to the ad platform for each sign up: 

  • {{userid}} - This is the signed up user’s unique Id assigned by the platform
  • {{name}}
  • {{email}}  
  • {{phone}}
  • {{created_at}} - The captured date and time

For example, to send the user’s email or/and phone, you must include {{email}}   or/and {{phone}} in your code - this will result as e.g. kno@example.com, +911111111111. 

Purchase Tracking Code 

Website Builder > Custom Code > Purchased Tracking Code allows you to track all successful purchases (after payment) on your Knorish site - this field allows adding code specifically to the thank you page for your course purchases, and so your purchased tracking code will fire information back to the software whenever a successful course purchase is made.

Simply copy the code received from the ad platform and paste the code here.


You can also add the below listed Liquid variables to push data to the ad platform for each sign up:

  • {{orderid}} - This is the unique order identity assigned by the platform
  • {{coursenames}}
  • {{courseIds}} - This is the unique course ID for the purchased course
  • {{buyeruserid}} - This is the unique buyer user identity 
  • {{totaldiscount}} - Applicable discount amount
  • {{totalunpaid}}
  • {{ordered_at}} - The captured date and time of purchase

For example, to send the order id include {{orderid}}  in your tracking code - this will output the knorish unique order id.

Testing The Events On Facebook

Facebook Pixel Sample Code (please don't use in your production):

<!-- Facebook Pixel Code -->
<script>
!function (f, b, e, v, n, t, s) {
if (f.fbq) return; n = f.fbq = function () {
n.callMethod ?
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
};
if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0';
n.queue = []; t = b.createElement(e); t.async = !0;
t.src = v; s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '794542801131255');
fbq('track', 'PageView');
fbq('trackCustom', 'UserSignup', {
userid: '{{userid}}',
name: '{{name}}',
email: '{{email}}',
phone: '{{phone}}',
created_at: '{{created_at}}'
});
</script>
<noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=794542801131255&ev=PageView&noscript=1" />
</noscript>
<!-- End Facebook Pixel Code -->


<!-- Facebook Pixel Code -->
<script>
!function (f, b, e, v, n, t, s) {
if (f.fbq) return; n = f.fbq = function () {
n.callMethod ?
n.callMethod.apply(n, arguments) : n.queue.push(arguments)
};
if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0';
n.queue = []; t = b.createElement(e); t.async = !0;
t.src = v; s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s)
}(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '794542801131255');
fbq('track', 'PageView');
fbq('trackCustom', 'CoursePurchase', {
orderid: '{{orderid}}',
coursenames: '{{coursenames}}',
courseids: '{{courseids}}',
buyeruserid: '{{buyuserid}}',
totaldiscount: '{{totaldiscount}}',
totalpaid: '{{totalpaid}}',
ordered_at: '{{ordered_at}}'
});
</script>
<noscript>
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=794542801131255&ev=PageView&noscript=1" />
</noscript>
<!-- End Facebook Pixel Code -->

Facebook Pixel View

To check the efficacy of the embedded code, you can also run a test on Facebook and check for all the test events fired as part of the process. Attached is the sample screenshot of the test conducted:

Note: Some of the popular and most common uses for tracking codes include tracking conversions based on promotional and advertising campaigns run on Google and Facebook. Hence, you can also learn more about Integrating Google Analytics, Google Tag Manager Integration, and Facebook Pixel Integration

Testing The Events On Google Analytics

Google Analytics Sample Code (please don't use in your production):

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
// send non-interaction events - start
gtag('event', 'UserSignup', {
'event_label': 'Sample label name',
'event_category': 'Sample category name',
'non_interaction': true
});
// send non-interaction events - end
gtag('config', 'UA-XXXX');
</script>


<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
// send non-interaction events - start
gtag('event', 'CoursePurchase', {
'event_label': 'Sample label name',
'event_category': 'Sample category name',
'non_interaction': true
});
// send non-interaction events - end
gtag('config', 'UA-XXXX');
</script>

Google Analytics View