Translation Tags
Last updated
Last updated
In a situation when you want to track a conversion and you already have details about the conversion in dataLayer (which may be already used by some other GTM tag) but the data structure of the conversion does not match either the Google Ecommerce or Roivenue Measurement standard, you can create a new tag that will convert the data structure or change the logic how the event is triggered. To implement this you need to:
Make sure the event type already in dataLayer is not listed in event_types in roivenue.tracking.config variable. This is necessary to avoid duplicate events.
create a new tag that will be triggered by the event you would like to track. The tag will read the event data, translate it into roivenue format and then push a new event of type “roivenue_measurement_event” into dataLayer.
roivenue measurement tag is triggered by this event and capture it with its payload. The field type in the payload will work as the event type of the captured event.
Example of the tag is bellow.
The tag is being triggered by a standard conversion trigger. The tag reads the transaction details from a dataLayer variable named transactionData. Then it pushes a new event roivenue_measurement_event. This would be equivalent of calling this:
dataLayer.push({
Here is another example of a conversion tag. Its code does not use variables but use directly contents of dataLayer. It searches for the last event of type “purchase” in dataLayer and then translates and pushes a new event.
The event fields needed for conversion processing are described in the Tracking Purchases and Other Conversions section of the main implementation guide.