Adding Metrics Link Tracking to Listify via FacetWP
Link tracking is one of the premiere features of Metrics! If you’re using FacetWP with Listify and want to enable Metrics link tracking, you’ll need to locate the listings
FacetWP Template added by Listify and add these two lines:
Here’s the code to copy and paste:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
@link https://searchwp.com/v3/docs/kb/adding-metrics-link-tracking-to-listify-via-facetwp/ | |
// Add these lines BEFORE the existing template code. | |
do_action( 'searchwp_metrics_click_tracking_start' ); | |
add_action( 'listify_output_results', function() { | |
do_action( 'searchwp_metrics_click_tracking_stop' ); | |
} ); | |
// The existing Template code should be here. |
With those lines in place link tracking in Metrics will work as expected!