# Frequently Asked Questions

## What is the Google Tag (gtag)?

The Google Tag (formerly Google's Global Site Tag and also known as gtag.js) is a JavaScript tagging framework and API that allows you to send event data to Google Ads, Campaign Manager, Display & Video 360, Search Ads 360, and Google Analytics. This framework that allows a seamless integration between the Google products. It is important to note that gtag is *not* a tag manager, which might be confusing since the main `gtag.js` library is served from `www.googletagmanager.com`. But rest assured, we're not advocating for you to load a tag manager within a tag manager!&#x20;

## Do I need any other extensions?

Nope! There are a few other gtag extensions that Adobe has created, but you only need to install the one from Acronym in order to install all of the products on your site. Adding other gtag extensions may cause unexpected results, and is not recommended.

## Who created this extension?

The analytics team at [Acronym](https://www.acronym.com/?source=launch-extension:gtag:docs), a digital marketing agency and Adobe partner. We're based of out the Empire State Building in New York City, with offices around the world. We specialize in Analytics (including building custom private extensions!), Usability/UX Testing, Paid Search, Paid Social, Programmatic, and Organic Search (SEO). Please [contact us](https://www.acronym.com/contact-us/?source=launch-extension:gtag:documentation) to use for more information about who we are or how we can help you succeed.

## Can I set up Enhanced Conversions for Floodlights in this Extension?

Yes! Within a conversion [event](https://docs.acronym.com/analytics/adobe-launch/gtag/actions/event), a [custom data field](https://docs.acronym.com/analytics/adobe-launch/configuration#custom-data-fields) named `user_data` should be added. This data field's value should include a JavaScript object with key/value pairs based on [Google's documentation](https://support.google.com/sa360/answer/14218731?sjid=541248028899123067-NC). In this case, a custom code data element can be created to return the object that Google is expecting. The screenshot below shows an example of how this may look with a data element named `user_data`.&#x20;

<figure><img src="https://300935401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LZeIQ01HvLIR6WO-wx1%2Fuploads%2FbyC1zFfZCaUFIkx7QMga%2Fimage.png?alt=media&#x26;token=b0400948-329b-45b8-9ef2-ad0bbabdfaa0" alt=""><figcaption></figcaption></figure>

The `user_data` data element should return an object, such as the one below:

```javascript
{
    "sha256_email_address": "5359980d7c4050bf6dc81491bf58293eb3ce529674dbb5ea7a7abde014c2c83f",
    "phone_number": "21269107051",
    "address": {
        "street": "350 5th Ave",
        "city": "New York",
        "region": "NY",
        "postal_code": "10118",
        "country": "US"
    }
}
```

## How do I track my e-commerce data? <a href="#ecommerce" id="ecommerce"></a>

The gtag.js library passes e-commerce data within [custom data fields](https://docs.acronym.com/analytics/adobe-launch/configuration#custom-data-fields). Since Adobe Tags is data layer agnostic (meaning it does not have a set data layer format), it is ultimately up to you to create data element(s) that provide the data for the e-commerce fields.&#x20;

You can find all of the relevant information on [Google's Enhanced Ecommerce documentation](https://developers.google.com/analytics/devguides/collection/gtagjs/enhanced-ecommerce). For reference though, you can pass the following custom data fields:

| Custom Data Field | Format                                                            | Description                                                                                                                              |
| ----------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| items             | <p>An Array of Objects:</p><p><code>\[ { }, { }, { } ]</code></p> | <p>Each object should contain various properties </p><p>about the item / product on the page</p>                                         |
| promotions        | <p>An array of Objects:</p><p><code>\[ { }, { }, { } ]</code></p> | <p>Each object should contain the name and ID</p><p> of the promotions from the page / event</p>                                         |
| coupon            | String                                                            | The name of the coupon code entered                                                                                                      |
| value             | Number                                                            | <p>This can be mapped within events natively, </p><p>but for page views this should be the total value <br>of the items / products. </p> |
| checkout\_step    | Non-negative Integer                                              | <p>The step number of the checkout funnel the visitor</p><p>is currently on</p>                                                          |
| checkout\_option  | String                                                            | <p>An optional field that can provide more information</p><p>about the current checkout step</p>                                         |
| transaction\_id   | String                                                            | The unique ID for the purchase / transaction                                                                                             |
| currency          | String                                                            | The currency of the event's value                                                                                                        |
| tax               | Non-negative Float                                                | The amount of taxes collected, if applicable                                                                                             |
| shipping          | Non-negative Float                                                | The amount of shipping fees collected, if applicable                                                                                     |
| affiliation       | String                                                            | The store or affiliation from which this transaction occurred                                                                            |

### Example

Let's say you had the following data layer setup on your page:

```javascript
window.dataLayer = {
    "ecommerce": {
        "purchase_id": "123abc",
        "shipping": 20.00,
        "taxes": 5.25
    },
    "products": [
        {
            "id": "prodA",
            "name": "My awesome tshirt",
            "price": 12.45,
            "quantity": 5
        },
        {
            "id": "prodB",
            "name": "Foobar snacks",
            "price": 5.32,
            "quantity": 8
        }
    ]
};
```

In Tags, You could setup a few data elements that referenced the `dataLayer.products`, `dataLayer.ecommerce.purchase_id`, `dataLayer.ecommerce.shipping`, and `dataLayer.ecommerce.taxes` properties. From there, you can map the data elements in the custom data fields for the purchase event:

![An example of a purchase event, setup with the e-commerce data layer properties mapped via data elements.](https://300935401-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZeIQ01HvLIR6WO-wx1%2F-LZlZZUJI5TghRQyUFWL%2F-LZleAoxPkRK1Uh0X0iA%2Fecom_data_fields.png?alt=media\&token=c8954547-de85-4ac8-b515-03968b1a7438)

We're exploring solutions to make this easier for non-developers to implement. However, Tags is data layer agnostic and thus makes it challenging to cover all use cases in a simple UI.&#x20;

## Why do I see multiple requests to the Gtag library on the page?

You may see multiple instances of `https://www.googletagmanager.com/gtag/js` in your network requests. Our extension only loads one for the initial account. Due to the way Google configured the Gtag library, *each account* will load their own library file. Requests that contain `&cx=c` are loaded by the main Gtag library and not our extension.

## Why are my accounts not sending data when using a custom data layer?

A common issue we see is an existing on-page gtag implementation or a third-party library (e.g., consent managers) setting or overwriting the `gtag` function. Because of this, the `gtag` function pushes to the default `dataLayer` rather than the custom data layer variable. To remedy this, either remove the on-page code setting the `gtag` function, or use a [custom function name](https://docs.acronym.com/analytics/adobe-launch/configuration#function-name).

## What features or changes are planned for the extension?

The following items are planned in future releases:

* Add better support for Google's new "[Google Tag](https://blog.google/products/ads-commerce/simplify-measurement-with-google-tag/)" account type.
* Add support for Google's native [consent management](https://developers.google.com/tag-platform/devguides/consent).
* Add the ability to prevent accounts from automatically running the `config` command on a page.
* Allow custom Gtag library URL and/or code input (for those with more strict IT policies).
* Add support for e-commerce fields without having to create a custom data element.
* Add support to globally disable an account in the extension configuration (instead of either disabling it in every rule or removing it).

## I have a feature suggestion or would like to report a bug, who can I contact?

You can reach out directly to the extension engineering team via <launchsupport@acronym.com>.&#x20;

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.acronym.com/analytics/adobe-launch/gtag/faq.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
