When my page is displayed, I push some data to Google Tag Manager (GTM) dataLayer:
dataLayer.push({
event: "MY_EXPERIMENT",
variant: "A",
result: "FORM_DISPLAYED"
});
When the form is submitted, I push some new data:
dataLayer.push({
event: "MY_EXPERIMENT",
variant: "A",
result: "FORM_SUBMITTED"
});
I've created dataLayer variables in GTM, and I've inserted those in the category/action/label fields of my tag in GTM. One of the variables is setup like this:
The tag is triggered by URL path, and in preview mode it works.
However, when I look the event up in the live dashboard of Google Analytics, only "undefined" is displayed in the category/label/event columns. It seems to me the variables are not set up correctly, but I've looked through everything and it seems just fine.
What am I doing wrong?