offsite Referrer

Home Forums Quform WordPress offsite Referrer

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13042
    Andi
    Participant

    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

    #13061
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy