Skip to main content

Customer data with GTM

info

This guide will explain how to provide dynamic customer data through the GTM tag template installation

1. Create a variable

  • Click new on user defined variables

img

  • Choose Custom JavaScript

img

2. Add data to the variable

A custom javascript variable in Google Tag Manager needs to be a function that returns some value. A template code to start with in this case is

function() {
return {};
}

Furthermore, you can use other variables in the code by surrounding the name of them with curly brackets {{}} and GTM will give you suggestions of existing matching variables, see example below when searching for name.

img

Finally, as you can see in the example above, you can provide variable names with or without the quotation marks ". Bambuser support some built in variables that would be translated into the Agent's language. However, you can also use the quotation marks to write a human readable name of the variable you provide, like the "Membership ID" above.

3. Add variable to tag

  • Go to the Bambuser one-to-one tag.
  • Look for "Advanced Bambuser Features" and select the variable.

img