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

By using our AFL UTM Tracker plugin and the WooCommerce Zapier plugin, you will be able push to the conversion attribution data of your WooCommerce Orders to any of Zapier’s apps.

In this advanced Zapier tutorial, we will show you how to send the UTM parameters from the conversion attribution report of your WooCommerce Orders to Google Sheet.

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

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

Create a ‘Run Javascript’ Action

  1. Add a new Action.
  2. Search for Code by Zapier.
  3. Set the Action Event to Run Javascript and click Continue.
Zapier Run Javascript

Getting the Javascript Code

Depending on your Attribution Data Format setting, you would need to use paste the right Javascript code into Zapier Code textarea.

If your Attribution Data Format = Standard

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

If your Attribution Data Format = Fastest (JSON)

  1. Set up action > type afl_wc_utm_attribution into the Input Data field.
  2. In the right hand field, select 1. Meta Data Afl Wc UTM Attribution as the value.
  3. Copy and paste the code below into the Zapier’s Code textarea.
  4. Click on Continue.
Zapier Input Data
Zapier WooCommerce Javascript Code for Attribution Data Format = Fastest

Testing the Javascript Action

In the Test Action section, make sure that the ‘Test was successful’ like the screenshot below and that it contains at least some values. Otherwise, try submitting your form and click on the Retest & Review button.

Zapier Test was successful
Zapier – Test was successful

Connecting to Google Sheets

For this tutorial, we have created a Google Sheet in our Google Drive with 4 columns (Order ID, First UTM Source, First UTM Medium, Last UTM Source, Last UTM Medium).

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