Tracking Code for (on WooCommerce checkout)


CJ Affiliate (previously Commision Junction) is an affiliate service that can bring money and customers to your website. Learn more at

This plugin installs the necessary tracking code to participate in the CJ Affiliate network. The tracking code is added to the thank you page of each completed WooCommerce order and successful Gravity Forms submission.

WooCommerce or Gravity Forms is required, if you want the tracking code added to a different plugin, shoot me an email at (


  • The settings page. Once filled out, the tracking code will be added to the thank you page of each order placed.


1) Add the plugin through the ‘Plugins’ menu in WordPress

2) When prompted, activate the plugin

3) Go to Settings > CJ Tracking Code

4) Enter in your account info

5) The tracking code will then be included on the thank you page of WooCommerce orders, and on successful Gravity Form submissions.
Support WooCommerce 3.0+, and Gravity Forms 2.4+


July 29, 2019
CJ did not want to take the time to write an integration for WooCommerce (used by 2 Million plus websites), but thankfully Russell at WP Overwatch did. If the CJ Technical integration team tells you to develop custom code in order for their tracking code to work, then you need this plugin. Just install, then add your Tag ID, CID, and Type. DONE! Worked for me and CJ confirmed all the order details are passing thru. Thank you for making this plugin available.
Read all 2 reviews

Contributors & Developers

“Tracking Code for (on WooCommerce checkout)” is open source software. The following people have contributed to this plugin.


version 2.4

Makes cookies last for 120 days when using cookie storage instead of the default storage mechanism (CJ requires the cookies to last for 120 days).

version 2.3

Fixes a security issue where the cjevent was not being properly escaped.
Also, this update adds an alternate storage mechanism to aid in debugging problems.

version 2.2

Allow CJ tracking codes to be turned off for gravity forms or WooCommerce. Previously the tracking code was always added if the associated plugin was enabled.
Also fixes sending additional query parameter to CJ. I don’t think that feature was ever actually working.
Fixing unit tests

version 2.1

Fixing a fatal bug. The endswith function was never defined causing issues.

version 2.0

Adding Gravity Forms support

version 1.4.0

The item name is now set to SKU code if present, otherwise, the product title is used
Grabbing the cjevent is now a case-insensitive process

version 1.3.0

Added support for additional currencies. Thanks to kennyhunter16, the currency is now detected from the order that was placed.

version 1.2.0 added some new required fields. This update brings the plugin into conformation with their documentation at

version 1.1.0

Orders that originated from are now marked as such in the order notes

version 1.0.0

Initial commit