facebooktwittertrackingpinterest

social media sharing and tracking


Is there a way to track when user visits our page from social media like facebook, twitter or pinterest?

is there a way to add some parameters to the url so that it will be easier to track?


Solution

  • <?php  
      echo $_SERVER['HTTP_REFERER'];  
    ?>  
    

    This tiny php script enables you to know from where the user came from.

    EDITS

    As nyshangal asked for jsp code

    JSP

    request.getHeader("Referer");
    

    I am not good at JSP. After googling I found that this above code will return the referrer from where the user came from.

    Thank you