You will be able to send the captured UTM parameters for your WooCommerce Orders to any webhook URL using our AFL UTM Tracker plugin and the WooCommerce Webhook feature.
In this example, we will be sending the data to Zapier’s webhook.
For a full list of conversion attribution values which you can access, please view our Attribution Meta List.
Compatibility:
- WooCommerce Order
Steps
- Setup Zapier Webhook Trigger
- Setup WooCommerce Webhook
- Setup Code by Zapier
- Mapping UTM parameters in Google Sheet
Setup Zapier Webhook Trigger
- Sign-in into your Zapier account.
- Create a Zap.
- Find for the ‘Webhooks by Zapier’ trigger.
- Set the Trigger Event to ‘Catch’.
- Continue.
- Copy Custom Webhook URL.
- Continue.



Setup WooCommerce Webhook
- Go to your WooCommerce > Settings.
- Click the Advanced tab.
- Click the Webhooks sub-tab.
- Add webhook.
- Type in a Name (e.g. Zapier Order Created).
- Set the Status to Active.
- Set the Topic to Order Created.
- Paste the Zapier’s Custom Webhook URL into the Delivery URL field.
- Save webhook.
- Now try placing an Order through your checkout page.

Setup Code by Zapier
- Go back to Zapier and click on Test Trigger.
- You might need to retry the Test Trigger until WooCommerce sends out the data.
- Continue.

- Add a New Action.
- Search for Code by Zapier.
- Set the Action Event to Run Javascript
- Continue.

- Set up action > type metaData into the Input Data field.
- In the right hand field, select 1. Meta Data as the value.
- Copy and paste the JavaScript code below into the Zapier’s Code textarea.
- Click on Continue.

- Test action.
- Click Retest & Review if needed.
- You should see the values being populated like in the screenshot below.
- Continue.

Mapping UTM parameters in Google Sheets
For this tutorial, we will show you how to map the data obtained from the JavsScript action to your Google Sheet.
- Create a Google Sheet in your Google Drive.
- Add 4 columns:
- Order ID
- First UTM Source
- First UTM Medium
- Last UTM Source
- Last UTM Medium
- In Zapier, add a new Action to ‘Create Spreadsheet Row in Google Sheets’.
- Select the Google Sheet from your Google Drive.
- Select your Worksheet.
- Refresh your fields if you don’t see any columns.
- To map the First UTM Source field, select the dropdown > Run Javascript > Afl Wc Utm Utm Source 1st.
- Continue mapping for the other fields.
- Click on Continue.
- Turn on Zap.
