Skip to main content
Google tag (gtag.js)

What is a Google tag (gtag.js), connecting analytics and dynamic remarketing via gtag.js

Updated this week

The Google tag (gtag.js) is a versatile tool that simplifies the implementation of tracking actions on web pages. The Google tag has several advantages over the standard Google Analytics tracking code:

  • Easier customization of analytics tools;

  • Easier integration with other Google services;

  • Support for new analytics features that will appear in the future.

The tracking code for the Google tag looks like this:

Google tag tracking code — Cartum

Enabling the Google tag tracking code

The tracking code for the Google tag and all the necessary event handlers are already installed on your website by default.

To enable the Google tag, you only need to add tracking IDs to your website settings and activate the code. How to do this is described in this article.


How to connect conversion tracking and remarketing

The Google tag can be used to connect to your Google Ads account, which will allow you to track conversions and receive data for dynamic remarketing from your website.

To connect, you need to specify AW-GOOGLE_CONVERSION_ID in the site settings — a unique identifier that was provided when setting up conversion tracking.

In your Google Ads account:

  1. Sign in to your Google Ads account, select the Tools tab on the left, then go to Shared Library → Audience Manager in the menu and open the last tab, Your data sources.

  2. On the Google Ads tag card, click Set up tag. If you have already set up a tag, click the three-dot icon in the upper right corner of the card and select Edit source.

  3. In the tag settings, select the Install the tag yourself method and copy the value AW-GOOGLE_CONVERSION_ID in the tag code that appears.


​In your website admin panel:

  1. Go to the section Marketing → Marketing services.

  2. Click Google Tag - UA, GA4, AW (gtag.js) to enter the settings.

  3. Enter the Google Ads conversion tracking ID (AW-GOOGLE_CONVERSION_ID) in the Tracking ID field.

  4. Check the Active box to activate the Google tag, and then click Save.

Connecting the Google tag to the website — Cartum

Connecting an additional product through a Google tag

After enabling gtag.js for any product, you can configure it to work with other products by simply adding additional lines with code identifiers.

For example, you have specified the Google Analytics tracking ID in the settings, and now you want to connect Google Ads. To do this, add the line with the Google Ads ID (AW-GOOGLE_CONVERSION_ID) to the initialization code.

gtag('config', 'AW-GOOGLE_CONVERSION_ID');

Attention: this is the only situation when you can make changes to the standard Tracking code field in marketing systems.

Tracking code when connecting two marketing systems — Cartum

Tracking code when connecting two marketing systems

You can also use multiple Google Ads IDs to transfer data to multiple accounts at the same time.

Did this answer your question?