> ## Documentation Index
> Fetch the complete documentation index at: https://data-foundation.rockerbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Rockerbox UID to GTM Data Layer

If you need to use the Rockerbox UID in a GTM Tag, you can follow these steps to get that value available as a GTM Variable.

1. Create a new Tag in GTM with the following HTML:

```html theme={null}
<script>
  var rbuidSet = function(obj){
    var rbuid = !!obj && obj.rbuid;
    if (!!rbuid) {
      window.dataLayer.push({
        event: "rbuidSet",
        rbuid: rbuid
      })
    }
  }
  window.rbuidSet = rbuidSet;
</script>
<script src="https://getrockerbox.com/jpuid?jsonp=window.rbuidSet"></script>
```

Set the Tag to fire on All Pages.

![](https://mintcdn.com/rockerbox-a0a04d23/KE6Wr9FyqylkxRas/images/help-docs/rockerbox-uid-to-gtm-data-layer/1659130716254-2516-f-99-screen-shot-2021-03-19-at-12-20-46-am.png?fit=max\&auto=format\&n=KE6Wr9FyqylkxRas\&q=85\&s=cebdb47454feaebf8f7595b693567570)

1. Create a GTM variable for the `rbuid` Data Layer variable set above.

![](https://mintcdn.com/rockerbox-a0a04d23/Uljwe1x6jsho8VSM/images/help-docs/rockerbox-uid-to-gtm-data-layer/1659130716700-0-abb-4-b-0-screen-shot-2021-03-19-at-12-23-28-am.png?fit=max\&auto=format\&n=Uljwe1x6jsho8VSM\&q=85\&s=8c587754668201be57fd0d0218bd728b)

1. Create a Trigger that fires when the `Rockerbox UID` variable is set.

![](https://mintcdn.com/rockerbox-a0a04d23/Uljwe1x6jsho8VSM/images/help-docs/rockerbox-uid-to-gtm-data-layer/1659130717036-e-2148-ad-screen-shot-2021-03-19-at-12-24-37-am.png?fit=max\&auto=format\&n=Uljwe1x6jsho8VSM\&q=85\&s=29f127518e7806081ca36efa37eeeeec)

1. Finally, use the `Rockerbox UID` GTM Variable in the Tag that you need.

![](https://mintcdn.com/rockerbox-a0a04d23/Uljwe1x6jsho8VSM/images/help-docs/rockerbox-uid-to-gtm-data-layer/1659130717402-1-faa-3-f-7-screen-shot-2021-03-19-at-12-28-02-am.png?fit=max\&auto=format\&n=Uljwe1x6jsho8VSM\&q=85\&s=845ef2c9606958c62552b6999d13aa53)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.