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 AdWords, DoubleClick, or 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 AdWords, DoubleClick, and/or Google Analytics. Learn more
gtag()commands to capture events and send data to one or more products (e.g. AdWords, DoubleClick, and/or Google Analytics). 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 AdWords, DoubleClick, and Google Analytics. 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:
- AdWords conversion tracking and remarketing
- DoubleClick Campaign Manager and DoubleClick Bid Manager
- DoubleClick Search
- 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.