Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't load intercom in some pages? #657

Open
imclint21 opened this issue Sep 12, 2023 · 6 comments
Open

Don't load intercom in some pages? #657

imclint21 opened this issue Sep 12, 2023 · 6 comments
Assignees

Comments

@imclint21
Copy link

imclint21 commented Sep 12, 2023

Hi,

is it possible to don't boot intercom on some pages?

I tried somethings like this:

const forbiddenUrls = ["/purchases/create", "/products"];
return (
<IntercomProvider
  appId={INTERCOM_APP_ID}
  autoBoot
  shouldInitialize={!forbiddenUrls.includes(pathname)}>
  {children}
</IntercomProvider>
)

But it does not seems to work.

Regards

@nacq
Copy link

nacq commented Sep 12, 2023

Hey @imclint21, I didn't want to load the intercom scripts in certain pages and to do so I did something very similar to your example and it is working the only difference is that I'm not using the autoBoot prop

@imclint21
Copy link
Author

Hey @imclint21, I didn't want to load the intercom scripts in certain pages and to do so I did something very similar to your example and it is working the only difference is that I'm not using the autoBoot prop

Yes so you have to manually boot in each page no?

@nacq
Copy link

nacq commented Sep 13, 2023

Hey @imclint21, I didn't want to load the intercom scripts in certain pages and to do so I did something very similar to your example and it is working the only difference is that I'm not using the autoBoot prop

Yes so you have to manually boot in each page no?

Yes, that's what I'm doing. I have a wrapper component in charge of doing the boot and I'm wrapping with it the pages where I want the script to load

@imclint21
Copy link
Author

Any idea @devrnt ?

@devrnt
Copy link
Owner

devrnt commented Dec 18, 2023

Please provide a reproduction so I can take a look

@imclint21
Copy link
Author

Unfortunately I'll not have time, maybe I could help you tu understand what I want to achieve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants