Home › Forums › Quform WordPress › offsite Referrer
Hi,
I tried to catch the offsite referrer, to track, where the visitors came from, who sent a form.
So i putted the following in my functions.php:
function my_set_session_referer() { session_start();
if (!isset($_SESSION[‘referer’])) { $_SESSION[‘referer’] = $_SERVER[‘HTTP_REFERER’]; } } add_action(‘wp_loaded’, ‘my_set_session_referer’);
function my_get_session_referer($value) { session_start(); return isset($_SESSION[‘referer’]) ? $_SESSION[‘referer’] : ”; } add_filter(‘iphorm_element_value_referer’, ‘my_get_session_referer’);
and then made a hidden field, which gets the referrer. Unfotunately, most time I only get back the url of my website, but not the external referrer.
What’s wrong with my code?
Thanks Andy
You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.