AFL UTM Tracker Documentation

  1. Home
  2. Docs
  3. AFL UTM Tracker Documentation
  4. WooCommerce Integration
  5. Mapping conversion attribution data in Zapier

Mapping conversion attribution data in Zapier

You will be send the UTM parameters of your WooCommerce Order to any of Zapier’s apps by using our AFL UTM Tracker plugin and the WooCommerce Zapier plugin.

If you’re using the WooCommerce Webhook instead of the WooCommerce Zapier plugin, follow the documentation here instead.

In this Zapier example, we will show you how to send the First Touch UTM and Last Touch UTM of your WooCommerce Orders to Google Sheet.

The steps are similar if you’re planning to send the attribution data to your CRM app.

For a full list of conversion attribution values which you can access, please view our Attribution Meta List.

Steps

  1. Create a Trigger for a WooCommerce Order
  2. Setup Code by Zapier
  3. Mapping UTM parameters in Google Sheets

Create a Trigger for a WooCommerce Order

  1. Search for the WooCommerce app and set the Trigger Event to Order.
  2. Connect your WooCommerce account to Zapier.
  3. Set the Trigger Rule to Order Created.
Zapier WooCommerce Order Trigger

Setup Code by Zapier

  1. Add a New Action.
  2. Search for Code by Zapier.
  3. Set the Action Event to Run Javascript
  4. Continue.
Zapier Run Javascript
Run JavaScript Action
  1. Set up action > type metaData into the Input Data field.
  2. In the right hand field, select 1. Meta Data as the value.
  3. Copy and paste the JavaScript code below into the Zapier’s Code textarea.
  4. Click on Continue.
Zapier WooCommerce Javascript Code for Standard Attribution Data Format
Zapier WooCommerce Javascript Code for Attribution Data Format = Standard
  1. Test action.
  2. Click Retest & Review if needed.
  3. You should see the values being populated like in the screenshot below.
  4. Continue.
Zapier Test Action Screenshot
Zapier Test Action

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.

  1. Create a Google Sheet in your Google Drive.
  2. Add 4 columns:
    1. Order ID
    2. First UTM Source
    3. First UTM Medium
    4. Last UTM Source
    5. Last UTM Medium
  3. In Zapier, add a new Action to ‘Create Spreadsheet Row in Google Sheets’.
  4. Select the Google Sheet from your Google Drive.
  5. Select your Worksheet.
  6. Refresh your fields if you don’t see any columns.
  7. To map the First UTM Source field, select the dropdown > Run Javascript > Afl Wc Utm Utm Source 1st.
  8. Continue mapping for the other fields.
  9. Click on Continue.
  10. Turn on Zap.
Mapping the fields in Zapier
Mapping the fields in Zapier