# Working with Fueled’s BigCommerce Data Layer

## Why Leverage Fueled’s Data Layer?

If a merchant needs to set up multiple client-side attribution scripts to run on their BigCommerce store, leveraging our data layer can help ensure that the same event data is sent to all destinations. Our data layer defines a data model in one place for consistent tracking and metrics.

## Enabling Fueled’s Data Layer

Fueled’s data layer is enabled whenever our scripts are enabled via Scripts Manager.

## Data Layer Object Definitions

See [our data layer object definitions documentation](/apps/bigcommerce-marketplace-app/google-analytics-4-connector/ga4-bigcommerce-app-event-definitions.md).

## Leveraging Fueled’s Data Layer with Google Tag Manager

> ⚠️ **We are not fans of GTM here at Fueled…** While Google Tag Manager remains a popular way for marketing teams to inject and manage attribution tags and other scripts on their website, GTM is highly problematic:
>
> * Google Tag Manager is stripped from websites by ad blockers up to 12% of the time in the United States.
> * It’s difficult to document and control attribution configuration with GTM.
> * It’s difficult to debug errors in attribution scripts that are managed via GTM.
>
> That said, you can still leverage Google Tag Manager with our data layer to help ensure consistent tracking and client-side metrics.

Fueled’s data layer is instantiated in the DOM’s window\.dataLayer object, as a variable called <mark style="color:red;">`fueled`</mark>.

Inside your Google Tag Manager instance, you can map the data layer to the variables you need for GTM events.

Go “Variables” and click “New” to to create new user-defined variables.

<figure><img src="/files/AoYqsBEx7jroZA8Ah1Lk" alt=""><figcaption></figcaption></figure>

Then click “Data Layer Variable” as seen below.

<figure><img src="/files/2R2vOmsovXUNklBLFd5F" alt=""><figcaption></figcaption></figure>

An example of how you would access properties of Fueled’s data layer are described in the screenshot below.

<figure><img src="/files/XD4KBUvNvNU3rYM5Z1tu" alt=""><figcaption></figcaption></figure>

<mark style="color:red;">`fueled`</mark> is the javascript variable to which we populate all of our event and data layer data. To access customer-related data (when a shopper is logged in), you’d select values such as:

* <mark style="color:red;">`fueled.customer.first_name`</mark>
* <mark style="color:red;">`fueled.customer.email`</mark>

## Getting Assistance with Fueled’s Data Layer

For help working with our data layer, please consider [joining our Community Slack Channel.](/more-info/get-support.md)


---

# 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://learn.fueled.io/apps/bigcommerce-marketplace-app/google-analytics-4-connector/bigcommerce-event-tracking/working-with-fueleds-bigcommerce-data-layer.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.
