1. Home
  2. Docs
  3. AFL UTM Tracker Documentation
  4. Misc / Issues
  5. Tracking UTM on Custom WordPress Page Template

Tracking UTM on Custom WordPress Page Template

If you want to track UTM parameters on custom WordPress pages, there are 2 lines of code which you can implement in your PHP file.


  • AFL UTM Tracker version 2.5.2 and above.
  • jQuery.

What is Custom WordPress Page Template?

WordPress allows you to use custom page templates. In the custom template, a web developer might not call the get_header() or wp_head() function. This prevents any plugins from loading the CSS or JavaScript file to the page.

Manually load our JS file

Make sure to add our lines below your jQuery file.

1. Output our JavaScript variable

<?php AFL_WC_UTM_PUBLIC::print_js_tracking_variable(); ?>

2. Load our JavaScript tracking file

<?php AFL_WC_UTM_PUBLIC::print_js_tracking_file(); ?>

Sample Code