fbclid는 무엇입니까? 새로운 페이스 북 매개 변수
이틀 동안 Facebook에 게시 한 URL에 매개 변수가 추가 된 것을 확인했습니다.
?fbclid=uFCrBkUgEvKg...
더 정확하게 말하면 다음과 같습니다.http://example.com?fbclid=uFCrBkUgEvKg...
이 매개 변수가 무엇을하는지 아는 사람이 있습니까?
그것은 무엇이며 개발자의 용도는 무엇입니까?
귀하의 의견에 감사드립니다.
내가 알고 gclid
에 대한 짧은 ( G oogle CL 싫어지기 아이디 entifier)
그것은 고유의 추적 매개 변수 것을 구글 귀하의 Google 광고 간의 전송 정보가 사용하는 계정과 Google 웹 로그 분석 계정.
Facebook 은 fbclid
추적 분석 시스템을 개선하기 위해 똑같은 일 또는 유사한 일을해야합니다 .
이것은 나를 도왔습니다 : https://greasyfork.org/en/forum/discussion/44083/fbclid-tracking-parameter-attached-by-facebook
다음은 링크에서 인용 한 것입니다.
이 코드를 .htaccess 파일에 넣으십시오.
RewriteCond %{QUERY_STRING} "fbclid=" [NC] RewriteRule (.*) /$1? [R=301,L]
WordPress에서 작업하는 경우 :
RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} "fbclid=" [NC] RewriteRule (.*) /$1? [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
이 매개 변수를 제거하는 또 다른 방법은 (사용자가 URL을 수동으로 제거하지 않고도 공유 할 수 있도록) JavaScript 및 history.replaceState
.
모든 크레딧은 원저자로 이동합니다-https: //www.michalspacek.cz/zmena-url-a-skryvani-fbclid-pomoci-javascriptu
링크의 코드 :
(function() {
var param = 'fbclid';
if (location.search.indexOf(param + '=') !== -1) {
var replace = '';
try {
var url = new URL(location);
url.searchParams.delete(param);
replace = url.href;
} catch (ex) {
var regExp = new RegExp('[?&]' + param + '=.*$');
replace = location.search.replace(regExp, '');
replace = location.pathname + replace + location.hash;
}
history.replaceState(null, '', replace);
}
})();
내가 알기로 매개 변수는 사이트 방문자를 추적하는 수단이므로 사이트에 Facebook의 광고가 포함 된 경우 방문자의 기록 된 검색 습관에 맞게 사용자 정의 할 수 있습니다.
mod_rewrite
위 의 Apache 솔루션 은 전체 쿼리 문자열을 제거하기 때문에 문제가 있습니다. URL에 이미 쿼리 문자열이있는 경우 이로 인해 중단됩니다. fbclid
매개 변수 만 제거하려면 Facebook이 항상 URL에 추가하므로 항상 마지막이라는 점에 유의하는 것이 좋습니다. 그것은 mod_rewrite
코드를 약간 단순화합니다 . 이것이 제가하는 것입니다:
# Strip Facebook spyware tokens
RewriteCond %{REQUEST_METHOD} =GET [NC,OR]
RewriteCond %{REQUEST_METHOD} =HEAD [NC]
RewriteCond %{QUERY_STRING} ^(.*)&?fbclid=[^&]+$ [NC]
RewriteRule ^/?(.*)$ /$1?%1 [NE,L,R=301,E=limitcache:1]
Header always set Cache-Control "max-age=604800" env=limitcache
The E=limitcache:1
flag and Header
directive is to limit how long the 301 redirect is cached. By default many browsers cache it literally forever. This reduces that to one week (or 604,800 seconds). I may be in a minority in thinking this, but that seems good practice to me. I don't know how long fbclid
tokens persist, but if they're long-lasting, it means Facebook will be directing visitors to the same URLs for a long time, and if you ever want to support Facebook's targeted adverts, or if they start using the fbclid
for other functionality that you need, you may find these permanently-cached redirects come back to bite. But if you're willing to risk it, you can delete both the Header
directive and the E=limitcache:1
flag.
The two tests of %{REQUEST_METHOD}
are to prevent Apache from redirecting POST requests (or more esoteric requests like PUT or DELETE, if they're relevant). Most browsers change the request to be a GET requests on a 301 or 302 redirect, which is explicitly allowed by RFC 7231. There is a new 308 redirect code must not have its method rewritten, but unfortunately it's not supported by Internet Explorer on Windows 7 (and probably never will be).
참고URL : https://stackoverflow.com/questions/52847475/what-is-fbclid-the-new-facebook-parameter
'Nice programing' 카테고리의 다른 글
C에서 "[*]"(별표 수정 자)는 무엇을 의미합니까? (0) | 2020.10.30 |
---|---|
애플 터치 아이콘의 정확한 픽셀 치수는 무엇입니까? (0) | 2020.10.30 |
Android XML에서 여러 문자열을 연결하는 방법은 무엇입니까? (0) | 2020.10.30 |
Android-API 23에 대해 onAttach (Context)가 호출되지 않음 (0) | 2020.10.30 |
이미지 src를 데이터 URL로 설정하면 즉시 사용할 수 있습니까? (0) | 2020.10.30 |