There was a problem loading the comments.

Should I update my existing UET tag to new syntax

Knowledge Base  »  PPC Management  »  Viewing Article

  Print

We recommend doing so to take advantage of the new syntax's benefits.

 

Update your UET tags to the new syntax

Benefits of using the new syntax

The new syntax:

  • Automatically URL-encodes (percent-encoding) your parameter values, ensuring your URLs are not mistranslated.
  • Supports single-page application (SPA) websites.
  • Let's set page-level parameters for any compatible UET event on your webpage.
  • Has parameter names that are easy to understand, helping you organize and manage them.

What's different in the updated tags?

  1. The event action parameter is now required in both the custom event and variable revenue UET tags, and this parameter appears first in both cases.
  2. The JavaScript parameter names for custom events and variable revenue are now easier to understand:

81c805a3c770179c160200e3d8271442754a971b17454688565b5d780b0cc1d759342ae2238ab1e7?t=88e100bd43f6ce8fddc2256b206ec67a

 

Comparing the syntaxes

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>

 

Examples
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>

  

 


Share via
Did you find this article useful?  

Related Articles