referrer

How can I determine if the document.referrer is from my own site?

你说的曾经没有我的故事 提交于 2019-11-27 23:35:23
Each time a page is requested I get the referrer of the page it came from. I need to track just referrer from other sites, I don't want to track going from one page to another within my site. How can I do that? document.referrer.indexOf(location.protocol + "//" + location.host) === 0; Originally posted at JavaScript - Am I the Referrer? When someone comes to our website for the first time, we store the referrer in a cookie. This way, if they download our demo, we can get the original referrer from the cookie and we learn what sites are effective in driving leads to us. Of course, every

Inspect the referrer in PHP

一曲冷凌霜 提交于 2019-11-27 22:03:15
Is it possible to check who is entering your website in PHP. I have a web application ( written in PHP) that should only allow users entering from some particular websites. Is it possible to get the referral websites by examining the _Request object? If yes, how? alex Yes, but keep in mind some proxies and other things strip this information out, and it can be easily forged. So never rely on it. For example, don't think your web app is secure from CSRF because you check the referrer to match your own server. $referringSite = $_SERVER['HTTP_REFERER']; // is that spelt wrong in PHP ? If you want

How to get the previous url using PHP

两盒软妹~` 提交于 2019-11-27 18:05:26
Suppose my site's url is given as hyperlink on some page on the internet; that page could be anything on internet - blog, orkut, yahoo, even stackoverflow etc, and someone clicks on it,and visited my site. So can we know, using php, the previous url from which the visitor came to my page? Use the $_SERVER['HTTP_REFERER'] header, but bear in mind anybody can spoof it at anytime regardless of whether they clicked on a link. Andreyco $_SERVER['HTTP_REFERER'] is the answer TenTen Peter $_SERVER['HTTP_REFERER'] will give you incomplete url. If you want http://bawse.3owl.com/jayz__magna_carta_holy

ASP.NET - Response.Redirect Not Populating Url Referrer

℡╲_俬逩灬. 提交于 2019-11-27 17:47:50
问题 I feel like i've done this a ton of times, but i can't for the life of me figure out what is going wrong. Default.aspx: protected void Page_Load(object sender, EventArgs e) { var r1 = Request.UrlReferrer; // null var r2 = Request.ServerVariables["HTTP_REFERRER"]; // null } SingleSignOn.aspx: protected void Page_Load(object sender, EventArgs e) { Response.Redirect("/"); } If i type "/SingleSignOn.aspx" in the URL, it redirects to Default.aspx, but the referrer is null. What am i missing here?

jQuery check if Cookie exists, if not create it

送分小仙女□ 提交于 2019-11-27 12:20:39
I cannot get this code to work I must be missing something pretty simple. I am trying to check to see if a Cookie exists, if it does {do nothing} if it doesn't {create it}. I am testing the cookie by including an alert on a page. Basically I do not want the cookie to keep re-creating with a referral url, I am trying to grab only the FIRST referred URL. $(document).ready(function(){ if ($.cookie('bas_referral') == null ){ var ref = document.referrer.toLowerCase(); // set cookie var cookURL = $.cookie('bas_referral', ref, { expires: 1 }); } }); Displaying the current cookie contents: // get

Get the referrer, paid/natural and keywords for the current visitor with Google Analytics

主宰稳场 提交于 2019-11-27 12:12:40
Is it possible to get the following information about the current visitor using Google Analytics API with JavaScript? Referrer site ('Source' in GA) Paid or natural ('Medium' in GA) Keyword First time/returning Number of visits If it's not possible with Google Analytics API is there any other easy way to do it (apart from parsing HTTP Referer, storing the visits statistics in DB etc.)? If you're still using ga.js (the legacy version of Google Analytics tracking code), you can use the below code to generate the values you want within the browser, by reading browser cookies. (Most people will

Stop link from sending referrer to destination

▼魔方 西西 提交于 2019-11-27 10:55:40
I have a page where I don't want the outbound links to send a referrer so the destination site doesn't know where they came from. I'm guessing this isn't possible but I just want to make sure there weren't any hidden javascript magic that could do it and that would work with some (if not most) browsers. Maybe some clever HTTP status code redirecting kung-fu? Something like this would be perfect <a href="example.com" send_referrer="false">link</a> Drewmate I was looking for just the same thing, and it seems like this will be a feature of HTML5 . The tag you are looking for is rel="noreferrer" .

Checking the referrer

左心房为你撑大大i 提交于 2019-11-27 10:41:46
I'm using this to check if someone came from Reddit, however it doesn't work. var ref = document.referrer; if(ref.match("/http://(www.)?reddit.com(/)?(.*)?/gi"){ alert('You came from Reddit'); } else { alert('No you didn\'t'); } Suggestions on the regular expression are most welcome too. Try this: if (ref.match(/^https?:\/\/([^\/]+\.)?reddit\.com(\/|$)/i)) { alert("Came from reddit"); } The regexp: /^ # ensure start of string http # match 'http' s? # 's' if it exists is okay :\/\/ # match '://' ([^\/]+\.)? # match any non '/' chars followed by a '.' (if they exist) reddit\.com # match 'reddit

Install referrer is not tracking on android web market

只谈情不闲聊 提交于 2019-11-27 06:55:24
问题 When installing an app via the Market app on a phone, the app will correctly receive the referrer information passed to it (as described here: http://code.google.com/mobile/analytics/docs/android/#android-market-tracking). However, when installing the same app with the same referrer via the web-based Market, the referrer information is dropped and isn't received by the app. This makes campaigns targeting your app from the web impossible to track. Is it possible to track install referrer via

Redirect based on referrer URL

蹲街弑〆低调 提交于 2019-11-27 05:55:41
问题 In my site I have a password protected page containing some links to other sites also operated by myself that cannot be password protected. I would like to place a HTML code onto one of the other sites I operate that checks that the person arriving at the page has been referred from the URL of the 'Links Page' . (I understand that this is not a secure option) Summary: If Referrer = 'Links Page URL' *then* Do nothing *Else* Redirect: www.google.com. Does anyone know a simple HTML/ Javascript