I have created the following custom javascript variable in Google Tag Manager:
function() {
return {{Click Text}} || {{Click Element}};
}
which uses the built in variables Click Text and Click Element. I am using this variable as the label of a tag, which is triggered by any click.
This works perfectly well when the tags are triggered from localhost and the labels arrive correctly to Google Analytics (I'm using universal analytics). However, for my production website the label always shows up as (not set) in Google Analytics. What causes this discrepancy?