How to use the Google Tag Snippet Generator
- Choose Google tag to install GA4 or Google Ads directly, or Tag Manager if you manage tags in a GTM container.
- Enter your IDs — find the GA4 one in Admin → Data streams, and the container ID at the top of Tag Manager.
- Keep Consent Mode v2 defaults on if you show a cookie banner, and add only the options you need.
- Paste the head code into every page (Webflow: Site settings → Custom code), publish, and check the Realtime or DebugView report.
What each option adds
- Consent Mode v2 defaults —
gtag('consent', 'default', …)setsad_storage,ad_user_data,ad_personalizationandanalytics_storagetodeniedbefore any tag runs, withwait_for_updateso a banner has time to load. Your banner then callsgtag('consent', 'update', …). - Debug mode —
debug_mode: truesends events to DebugView in GA4. Turn it off before you go live, or the debug traffic is mixed into reports for a few minutes at a time. - Manual page views —
send_page_view: falsestops the automatic page view, for single-page apps that sendpage_viewon every route change. - Cross-domain tracking —
linker.domainsadds the_glparameter to links between your domains, so one visit across them stays one session. You also need the domains listed in the GA4 data stream settings. - User ID —
user_idjoins one person’s visits across devices. It must be your own internal ID; Google’s policies forbid sending emails, names or other personal data.
Google tag or Tag Manager?
The Google tag (gtag.js) is the shortest way to add GA4 or Ads to a site. Tag Manager loads a container you edit in its web interface, so marketers can add tags, triggers and pixels without touching the code — the better choice when a site has many tags. Use one or the other for the same GA4 property, not both, or every page view is counted twice. Then send events with the GA4 Event Code Generator and check that tags load with the Tracking Tag Checker.
Also searched as: gtag snippet generator, google tag code generator, ga4 install code, gtag.js code, google tag manager snippet, gtm install code, google ads conversion tag, consent mode default code.
Tools that pair well with the Google Tag Snippet Generator
- Event Tracking Script Generator — Track button clicks, links and form submits by adding attributes instead of code: data-track="sign_up_click" plus optional data-track-* parameters.
- Cookie Consent Banner Generator — Add a cookie consent banner to any site — Webflow, WordPress, Shopify or plain HTML — without a paid plugin.
- UTM Builder — Add utm_source, utm_medium, utm_campaign and friends to any link, see which GA4 channel the visit will land in, and tag a whole list of URLs at once.
- GA4 Request Decoder — Debug Google Analytics 4 without guesswork.