How can I add Conversion Pixels on successful purchases?

LifterLMS doesn’t have an official “thank you” or order confirmation page but does output a small bit of information in the URL which will allow developers to identify successful transactions and look up information related to the associated order and purchase.

This information will allow you to track conversions via tracking pixels for services like Facebook or Google Analytics.

Below is an example that displays how to verify an order has been completed and access information about the recently completed order.

This example adds two actions. One attached to wp_head and one to wp_footer. Ideally your tracking pixel should only be output once in either the header or footer. Depending on what your pixel requires delete the action which isn’t necessary.

This code should be added to your theme’s functions.php file or a custom plugin.

Last Updated on
Was this article helpful?