Or, embed this snippet using GenerateWP WordPress Plugin.

Download

Clone

traccia

con redirect

// Add Shortcode
function custom_shortcode( $atts ) {

	// Attributes
	extract( shortcode_atts(
		array(
			'redirect' => '',
			'page' => '',
		), $atts )
	);

	// Code
date_default_timezone_set("Europe/Rome");
$tm	= date("Y/m/d H:i:s");
$ref 	= $_SERVER['HTTP_REFERER'];
$agent	= $_SERVER['HTTP_USER_AGENT'];
$ip	= $_SERVER['REMOTE_ADDR'];
$domain	= $_SERVER['HTTP_HOST'];
$q	= $_SERVER['QUERY_STRING'];

$strSQL = "INSERT INTO track(tm, ref, agent, ip, domain, q) VALUES ('$tm','$ref','$agent','$ip','$domain','$q')";
$test=mysql_query($strSQL);

header( 'Location: '.$redirect.'' ) ;
}
add_shortcode( 'traccia', 'custom_shortcode' );