Created
November 10, 2021 08:10
-
-
Save sashadev-sky/6996fd0b66f91a57eb1b79b52fbf5fb5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { GtmInstance } from './types' | |
// will need this for multiple container environments | |
export default ({ $gtm }: { $gtm: GtmInstance }) => { | |
const gtagId = process.env.GOOGLE_TAG_MANAGER_ID | |
if (gtagId) { | |
$gtm.init(gtagId) | |
$gtm.push({ event: 'gtm.js', 'gtm.start': new Date().getTime() }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment