GTM Toolkit
Developer-Native Marketing
`gtm-toolkit init`
Bootstrap GTM Toolkit inside a project, scaffold config files, and establish baseline folders in one step.
Usage
Initialize GTM Toolkit with sensible defaults
# Standard initialization
npx gtm-toolkit init
Options
Fine-tune interactive prompts and dependency installation
--framework <type>
Set opinionated defaults for nextjs, astro, nuxt, or custom projects--analytics <ga4|posthog|both>
Preselect analytics providers before prompts appear--skip-install
Skip installing recommended dependenciesFiles Created
What to expect after running the command
Configuration: writes
gtm.config.js with the answers you provide in the prompt flow.Dependencies: installs helper packages such as
next-sitemap, react-ga4, or posthog-js when relevant (skip with --skip-install).Content directories: referenced but not created automatically—run
mkdir -p content/blog yourself if needed.Follow-up Checks
Verify a successful initialization
- • Run
npx gtm-toolkit lint content/blog --format consoleto ensure the config loads. - • Commit the generated files so later changes are traceable in Git.
- • Update
gtm.config.jswith your productionsiteUrland analytics IDs.