https://github.com/cherouvim/remove-fbclid
Removes the fbclid parameter from the URL which is appended by facebook.
https://github.com/cherouvim/remove-fbclid
facebook hacktoberfest javascript-library url
Last synced: about 1 year ago
JSON representation
Removes the fbclid parameter from the URL which is appended by facebook.
- Host: GitHub
- URL: https://github.com/cherouvim/remove-fbclid
- Owner: cherouvim
- License: mit
- Created: 2019-04-19T05:34:25.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-08T06:33:14.000Z (about 6 years ago)
- Last Synced: 2025-05-05T17:25:07.391Z (about 1 year ago)
- Topics: facebook, hacktoberfest, javascript-library, url
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# remove-fbclid
[](https://www.npmjs.com/package/remove-fbclid)
[](https://bundlephobia.com/result?p=remove-fbclid)
[](https://travis-ci.org/cherouvim/remove-fbclid)
[](http://makeapullrequest.com)
[](https://github.com/prettier/prettier)
[](https://opensource.org/licenses/MIT)
Removes the parameter `fbclid` that facebook adds on some shared URLs.
The `fbclid` parameter will be removed via a `window.history.replaceState` on [current browsers](https://caniuse.com/#search=replacestate) and via `window.location.replace` on older ones.
More info about that parameter:
- https://fbclid.com/
- https://stackoverflow.com/q/52847475/72478
## Usage
Do the following once, on initial page load:
```js
const removeFbclid = require("remove-fbclid");
removeFbclid();
```
or:
```js
import removeFbclid from "remove-fbclid";
removeFbclid();
```
## Other tips (unrelated to this JavaScript library)
Add the following in your `/robots.txt` to prevent indexing:
```
User-agent: *
Disallow: /?fbclid*
```
## License
[MIT](https://choosealicense.com/licenses/mit/)