Skip to content

Commit b0e179e

Browse files
update referer header issue description
1 parent 335ea35 commit b0e179e

File tree

1 file changed

+6
-2
lines changed
  • src/content/docs/cloudflare-challenges/troubleshooting

1 file changed

+6
-2
lines changed

src/content/docs/cloudflare-challenges/troubleshooting/index.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ Challenges are not supported by Microsoft Internet Explorer. If you are currentl
2222

2323
### Referer header
2424

25-
When a request is sent with a referer header, the user will receive a Challenge Page as a response. Upon solving the Challenge Page, the request with the referer is sent to the origin, and the response to the request is served to the user. The JavaScript on the response page may read the value of `document.referer`, but it will be inaccurate. This affects tools such as Google Analytics, which reads the referer from JavaScript.
25+
Your visitor's HTTP request contains a referer header set to the search engine that they came from. When they encounter and solve a Challenge Page, the request with the referer is sent to the origin, and the response to the request is served to the user. The JavaScript on the response page may read the value of `document.referer`, but it will not be accurate.
2626

27-
You can add tracking scripts to Challenge Pages to capture the correct referer header on the initial request.
27+
For example, a visitor to your website who is coming from a given search engine is challenged by a WAF rule via an interstitial Challenge Page served by challenges.cloudflare.com. Once the visitor loads the website’s home page, the `document.referer` value is no longer the search engine but challenges.cloudflare.com.
28+
29+
This affects tools like Google Analytics, which reads the referer from JavaScript, since it replaces the previous site that visitors came from.
30+
31+
You can add tracking scripts, such as the Google Tag Manager Javascript, within the Challenge Pages to capture the correct referer header on the initial request.
2832

2933
### Cross-origin resource sharing (CORS) preflight requests
3034

0 commit comments

Comments
 (0)