Don't know what UET is? Check out What is UET and how can it help me?
We have updated the syntax of JavaScript UET tags. We recommend that you update any existing UET tags in your website's code to take advantage of the new syntax.
The new syntax:
Old syntax | New syntax |
---|---|
ea | event |
ec | event_category |
el | event_label |
ev | event_value |
gv | revenue_value |
gc | currency |
Old syntax (custom event):
<script>
window.uetq = window.uetq || [];
window.uetq.push ({'ec': 'Replace_with_Event_Category', 'ea': 'Replace_with_Event_Action', 'el': 'Replace_with_Event_Label', 'ev': 'Replace_with_Event_Value'});
</script>
New syntax (custom event):
<script>
window.uetq = window.uetq || [];
window.uetq.push ('event', 'Replace_with_Event_Action', {'event_category': 'Replace_with_Event_Category', 'event_label': 'Replace_with_Event_Label', 'event_value': 'Replace_with_Event_Value'});
</script>
Old syntax (variable revenue):
<script>
window.uetq = window.uetq || [];
window.uetq.push ({'gv': 'Replace_with_Revenue_Value', 'gc': 'Replace_with_Currency_Code'});
</script>
New syntax (variable revenue):
<script>
window.uetq = window.uetq || [];
window.uetq.push ('event', '', {'revenue_value': 'Replace_with_Revenue_Value', 'currency': 'Replace_with_Currency_Code'});
</script>
Tracking all four custom event types:
<script>
window.uetq = window.uetq || [];
window.uetq.push ('event', 'Contoso_Event_Action', {'event_category': 'Contoso_Event_Category', 'event_label': 'Contoso_Event_Label', 'event_value': 'Contoso_Event_Value'});
</script>
Not tracking event action, but tracking the other three event types (note that 'event' remains with its value empty):
<script>
window.uetq = window.uetq || [];
window.uetq.push ('event', '', {'event_category': 'Contoso_Event_Category', 'event_label': 'Contoso_Event_Label', 'event_value': 'Contoso_Event_Value'});
</script>
Only tracking event action (note that the other, unnecessary event types have been removed):
<script>
window.uetq = window.uetq || [];
window.uetq.push ('event', 'Contoso_Event_Action', {});
</script>