const App = () => {
return (
<>
{process.env.NEXT_PUBLIC_GTM_ID && (
<LoadTagManager
measurementID={process.env.NEXT_PUBLIC_GTM_ID}
/>
)}
</>
);
};
import {
EventType,
pushDataLayerEvent,
} from '@freshheads/analytics-essentials';
pushDataLayerEvent({
type: EventType.CLICK,
name: 'hero_button_click',
});
pushDataLayerEvent({
type: EventType.CLICK,
name: 'hero_button_click',
context: {
// context is typed based on type
// you can always extend context with your custom properties
}
}),