This use-experiment hook enables easy execution of Google Optimize experiments on a Next.js page.
- Replace
GTM-XXXXin_document.jswith your Google Tag Manager ID. - Ensure that you pass the correct
experimentIdto the hook. - In Google Optimize, set the "Activation event" for the experiment to
Custom event: optimize.activate