zsajjad / react-facebook-pixel

React JS wrapper for Facebook's Pixel
MIT License
233 stars 86 forks source link

fbq.disablePushTrack #70

Open aerospatiale opened 3 years ago

aerospatiale commented 3 years ago

Is it possible to turn off the history state listener (fbq.disablePushTrack) with this library?

johelder commented 2 years ago

for future readers, you can get the fbq method directly from the DOM. Like this:

ReactPixel.init('your-pixel-id);
window.fbq.disablePushState = true;

if you are using typescript:

ReactPixel.init('your-pixel-id);
// @ts-expect-error: **add-expect-error-description**
window.fbq.disablePushState = true;