elgorditosalsero / react-gtm-hook

Easily manage the Google Tag Manager via Hook
https://elgorditosalsero-react-gtm-hook.netlify.app/
MIT License
220 stars 28 forks source link

[Bug]: Custom domain not working #62

Closed thebiltheory closed 2 years ago

thebiltheory commented 2 years ago

Expected Behavior

Expecting the google tag manager to be https://custom.com/gtm.js when provided with a custom domain configuration

  const gtmParams: ISnippetsParams = {
     id: "GTM-ABCD",
+   customDomain: "https://custom.com",
  };

<GTMProvider state={gtmParams}>
   ...
</GTMProvider>

Current Behavior

Script url not being replaced with the cusotm domain =>https://www.googletagmanager.com/gtm.js?id=GTM-ABCD

Steps to Reproduce

  1. Wrap with @elgorditosalsero/react-gtm-hook Provider
  2. Configure a custom domain
  3. Inspect DOM