Stape
Search
Try for free

Object Builder Variable for server Google Tag Manager

Updated
Sep 10, 2024
Published
Aug 23, 2024

Object Builder Variable for server Google Tag Manager (sGTM), developed by Stape, is a handy tool for creating and organizing data structures in the GTM environment. Using the variable, you will be able to build complex data-tracking schemes and efficiently manage their objects.

In this article, you will find out more about variable use cases and how to set it up.

Use cases

The variable's name says for itself - with its help you can create and organize data as JavaScript objects within the GTM environment. It will be helpful for the following purposes:

  • Organize information and build complex data structures. Define properties and assign values to create a structured data object.
  • Create complex tracking. The structures built with this variable can be utilized for tracking, manipulating the data layer, or passing organized information to tags and other variables within your server-side GTM setup.

How to set up Object Builder Variable

2. Go to server GTM → click “Templates” → find “Variable Templates” → click “Search Gallery”. Find “Object Builder” variable in the gallery and click “Add to workspace”.

Search Gallery in Variable Templates of GTM

OR

You can download the Object Builder Variable from GitHub. In “Variable Templates,” click “New” → “Import” and choose the variable you downloaded.

Import Object Builder Variable in Variable Templates of GTM

3. Go to the “Variables” → find the “User-Defined Variables” section → click “New” → choose “Object Builder” variable type.

Object Builder variable type

4. Configure variable.

4.1 Put object inside array - if you check this box, the built object will be placed inside the array.

4.2 Add property and values - they can be chosen from the variables list or specified manually.

4.3 (Optional) Format Value - select the options to format the value this variable will output. You have the following options:

  • Change Case to… (lowercase or uppercase)
  • Convert null to… (text or variable)
  • Convert undefined to… (text or variable)
  • Convert true to… (text or variable)
  • Convert false to… (text or variable)
Example of Object Builder Variable configuration

Conclusion

Object Builder Variable will be helpful for those who want to create and effectively organize complex data structures in the GTM environment. The configuration process is simple; it takes just a few steps to complete. The variable itself is easy to customize to your needs. If you need any help with variable configuration, don’t hesitate to contact our support team.

Tagged with:gtm server

Try Stape for all things server-sideright now!