gtag.js makes it easy to send data to multiple Google products by adding code to your website. There's no need to create additional accounts or manage configuration in a separate interface.
High level steps
Regardless of whether you want to send data to Google Ads, Campaign Manager, Display & Video 360, Search Ads 360, or Google Analytics, the basic model for using gtag.js is as follows:
- Add the global snippet to every page on your site and configure it to work with each product. Learn more
gtag()commands to capture events and send data to one or more products (e.g. Google Ads, Google Analytics, etc.). Learn more
Once the tag has been installed, you can configure it to handle multiple tracking and remarketing configurations, all from the same gtag.js framework.
About this guide
This guide will help you get started using gtag.js for common use cases that apply across the Google Marketing Platform. Specifically, it illustrates:
- basic configuration for gtag.js across supported products.
- how to send event data.
For product-specific docs related to gtag.js, refer to the following:
- Google Ads conversion tracking and remarketing
- Campaign Manager and Display & Video 360
- Search Ads 360
- Google Analytics
Google Tag Manager or gtag.js?
Google Tag Manager is a robust and full-featured tag management system, which supports Google and 3rd party tags. You can add and modify tags through the Tag Manager interface without adjusting the code on your site. Learn more
If you are already using Tag Manager, you should continue to do so. If you don't need a tag management system, it is fine to use the gtag.js tracking codes provided by each product.
Tag Manager and gtag.js are built on the same infrastructure, and should work properly if deployed on the same page.