|
This article covers the following: |
Overview
Transaction event mapping lets Wingify capture transaction details from your Google Tag Manager (GTM) data layer. It maps data layer keys, such as order ID, revenue, tax, and shipping, to the corresponding fields of the Wingify Transaction event. You can then use this transaction data in revenue metrics and reports without adding custom API code or CSS page selectors to your website.
For example, when a visitor completes a purchase, your website sends the details, such as the transaction ID, price, tax, and shipping, to the GTM data layer. Transaction event mapping uses these values to record the purchase in Wingify, allowing you to track revenue in reports.
Attention:
-
Transaction event mapping (GTM): Use this approach to capture transaction details from your GTM data layer. It is part of the Event mapping connection type, which allows Wingify to read your tag manager's data layer and record events in your Wingify account. This feature is available only for GTM.
- Custom event mapping (GTM or Tealium iQ): To trigger custom events from your data layer, with Google Tag Manager (GTM) or Tealium iQ, see Trigger Custom Events from Your Data Layer Using Event Mapping.
- API or rules-based transaction tracking: You can also track transaction events by calling the Wingify API from your website or by creating rules in Wingify, without using a tag manager. For more information, see Configure Transaction Event in Wingify Data Platform.
Key Benefits
- Uses existing data: Map purchase details that your website already sends to the GTM data layer. You do not need to add a separate API call to send each transaction to Wingify.
- Supports revenue tracking: Map purchase details, such as transaction ID and revenue, to transaction fields used for revenue metrics.
Prerequisites
- An active Wingify account with Admin access.
- The Wingify SmartCode installed on all web pages where transactions occur.
- Google Tag Manager (GTM) installed on your website, with purchase details, such as the order ID and the order amount, already being sent to the data layer.
Set Up Transaction Event Mapping
Use transaction event mapping when your website already sends purchase details to the GTM data layer.
For example, when a visitor completes a purchase, your website might send the following to the data layer:
dataLayer.push({
event: "purchase",
order_id: "ORD-1001",
price: 100,
tax: 10,
shipping: 20
});To map this purchase to a Wingify transaction event:
- From the left navigation panel of the Wingify dashboard, go to the Profile menu and then select Configurations > Integrations.
- Click the Google Tag Manager (GTM) tile.
- Under Active Connections, go to the Event mappings for Google Tag Manager (GTM) Data Layer table.
- In the Event mappings column, click Add Event mappings. If the connection already has event mappings, click the number of event mappings instead.
The Event mappings panel opens. - In the Event mappings panel, click Add Transaction Event Mapping.
The New transaction event mapping panel appears. - In the New transaction event mapping panel, enter the following:
- Specify the event to check: Enter the name of the data layer event that Wingify should check, such as purchase. Wingify records a transaction each time this event appears in the data layer.
- Enter a name for your Transaction Affiliation (ta): Enter a name to distinguish the transactions for your own reporting purposes. For example, Electronics purchase.
- Transaction ID (tid): Enter the data layer key that contains the order ID, such as order_id.
- Transaction revenue (tr): Enter the data layer key that contains the order amount, such as price.
- (Optional) Items: Select the appropriate option based on the data in your key:
- Total: Select this if your data layer key contains the total quantity of purchased items.
- Sum: Select this if your data layer key contains an array of objects, each with a quantity field. Wingify adds the quantity values across all objects.
- Count: Select this if your data layer key contains an array of objects, with each object representing one purchased item. Wingify counts the objects in the array.
- (Optional) Add optional variable: Click this link, select a variable from the list, and enter the data layer key that holds it. The list includes Shipping (ts), Transaction tax rate (tt), Currency (tc), Coupon code (tcc), Payment method (pm), Shipping method (sm), and Array of items.
- Click Create event mapping.
A confirmation message appears, and the mapping is added to your connection. The number of mappings appears in the Event mappings column of the connection's row.
After you create the event mapping, Wingify records a transaction whenever the specified event occurs.
The following table shows how the example data layer is mapped:
Field |
Value You Enter |
Value Wingify Captures |
| Specify the event to check | purchase | Event name |
| Enter a name for your Transaction Affiliation (ta) | Electronics purchase | Electronics purchase |
| Transaction ID (tid) | order_id | ORD-1001 |
| Transaction revenue (tr) | price | 100 |
| Optional variable: Transaction tax rate (tt) | tax | 10 |
| Optional variable: Shipping (ts) | shipping | 20 |
Troubleshooting
Issue |
Possible cause |
Recommended solution |
| The event is not captured. | The event name or data layer key in the mapping does not match the data layer. | Check the data layer on your website and make sure the event name and keys match exactly. |
| The transaction is captured with the wrong values. | A data layer key is mapped to the wrong Wingify field. |
Edit the mapping and enter the correct key for each field.
|
FAQs
-
What are the different ways to track transaction events in Wingify?
Wingify supports multiple approaches to track transaction events:- Transaction event mapping (GTM): Use this approach if your website already sends purchase details to the Google Tag Manager (GTM) data layer. Map the relevant data layer keys to Wingify transaction fields without adding a separate API call.
-
API or rules-based transaction tracking: Use this approach to send transaction details directly to Wingify by implementing an API call on your website or by configuring transaction tracking rules in Wingify, without using a tag manager.
For more information, see Configure Transaction Event in Wingify Data Platform
-
Do I still need the API or rules to track transactions?
Not necessarily. If your website already sends the purchase details to the GTM data layer, you can use transaction event mapping instead. The API and rules remain alternative methods for tracking transaction events.
-
Does Wingify show an error if I map the wrong key?
No. Wingify records the values it finds under the keys you enter. Make sure you enter the correct data layer keys.
-
Can I use transaction event mapping with Tealium iQ?
No. Transaction event mapping is available only for Google Tag Manager (GTM). If you use Tealium iQ, you can use custom event mapping to trigger a custom event when a purchase occurs. However, this does not capture transaction details such as the transaction ID or revenue. For more information, see Trigger Custom Events from Your Data Layer Using Event Mapping.
Need more help?
For further assistance or more information, contact Wingify Support.