> For the complete documentation index, see [llms.txt](https://doc.batch.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.batch.com/developer/technical-guides/how-to-guides/web/how-to-integrate-batchs-snippet-ecmascript-6-using-a-tag-manager.md).

# How to integrate Batch's snippet (ECMAScript 6) using a Tag Manager?

Here is how to integrate Batch scripts using a Tag Manager that does not support the most recent JavaScript versions.

Batch methods available in our [documentation](/developer/sdk/web/profile-data.md) (for example to collect profile data) are written in the latest available version of JavaScript. However, some Tag Management Systems do not support ECMAScript 6.

## Managing compatibility issues <a href="#h_f7192d47e1" id="h_f7192d47e1"></a>

In some cases, Batch JavaScript tags are not supported by default by Tag managers like Google Tag Manager (GTM) and Tag Commander due to the use of arrow functions.

In order to use the preconfigured JavaScript tags in these Tag Managers, you must remove all the arrow functions it contains. This can be done easily by using a tool like [Babel](https://babeljs.io/repl/#?browsers=\&build=\&builtIns=false\&corejs=3.6\&spec=false\&loose=false\&code_lz=Q\&debug=false\&forceAllTransforms=false\&shippedProposals=false\&circleciRepo=\&evaluate=false\&fileSize=false\&timeTravel=false\&sourceType=script\&lineWrap=false\&presets=env\&prettier=false\&targets=\&version=7.15.8\&externalPlugins=\&assumptions=%7B%7D).

## Babel <a href="#h_87fe25d96b" id="h_87fe25d96b"></a>

You can use our [pre-configured Babel link](https://babeljs.io/repl/#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011\&build=\&builtIns=false\&corejs=3.21\&spec=false\&loose=false\&code_lz=Q\&debug=false\&forceAllTransforms=false\&modules=false\&shippedProposals=false\&circleciRepo=\&evaluate=false\&fileSize=false\&timeTravel=false\&sourceType=module\&lineWrap=true\&presets=env%2Creact%2Cstage-2\&prettier=false\&targets=\&version=7.24.7\&externalPlugins=%40babel%2Fplugin-transform-arrow-functions%407.24.7\&assumptions=%7B%7D) to convert Batch tags into a JavaScript format compatible with Tag Management System tools.

{% hint style="warning" %}
Ensure that the plugin @babel/plugin-transform-arrow-functions is added in the bottom left corner of Babel.
{% endhint %}

<figure><img src="https://38998153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCL8wF0y1T2vLnm3yR2MW%2Fuploads%2FK53vT7l0VNkrATObpMyK%2Fweb_babel_240425.png?alt=media&amp;token=7a23782b-1f5c-45db-bdfa-944bfa01d1bc" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://doc.batch.com/developer/technical-guides/how-to-guides/web/how-to-integrate-batchs-snippet-ecmascript-6-using-a-tag-manager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
