How to Use Tracking Parameters with Quick Access Links

By default, PPWP Pro plugin allows you to track quick access link usage via our configuration popup as well as Statistics addon. You can find out how many times a specific link is clicked, who have clicked it to access your protected content, when they do it and where they come from.

In order to get more specific information, you can even add some tracking parameters to the quick access links, such as UTM codes.

Since PWPP Pro version 1.3.1, you can use the 5 UTM codes below in your URLs without any extra configuration.

  • utm_source
  • utm_medium
  • utm_campaign
  • utm_term
  • utm_content

If you want to use your own custom parameters, simply add the following code snippet into your (child) theme’s functions.php file.

Single quick access links

add_filter('ppwp_access_link', 'ppwp_create_access_link');
function ppwp_create_access_link($url)
{
	$args = [
		'custom-parameter-name',
	];

	foreach ($args as $arg) {
		if (isset($_GET[$arg])) {
			$url = add_query_arg($arg, $_GET[$arg], $url);
		}
	}
	return $url;
}

AL quick access links

add_filter('ppwp_al_access_link', 'ppwp_create_access_link');
function ppwp_create_access_link($url)
{
	$args = [
		'custom-parameter-name',
	];

	foreach ($args as $arg) {
		if (isset($_GET[$arg])) {
			$url = add_query_arg($arg, $_GET[$arg], $url);
		}
	}
	return $url;
}

Group quick access links

add_filter('ppwp_gp_access_link', 'ppwp_create_access_link');
function ppwp_create_access_link($url)
{
	$args = [
		'custom-parameter-name',
	];

	foreach ($args as $arg) {
		if (isset($_GET[$arg])) {
			$url = add_query_arg($arg, $_GET[$arg], $url);
		}
	}
	return $url;
}

Sitewide quick access links

add_filter('ppwp_sitewide_access_link', 'ppwp_create_access_link');
function ppwp_create_access_link($url)
{
	$args = [
		'custom-parameter-name',
	];

	foreach ($args as $arg) {
		if (isset($_GET[$arg])) {
			$url = add_query_arg($arg, $_GET[$arg], $url);
		}
	}
	return $url;
}
Lasted updated on November 24, 2020