# Send UTMs from WooCommerce to Google Analytics - HandL UTM Grabber Guide

## UTM attribution overview

This guide explains Send UTMs from WooCommerce to Google Analytics - HandL UTM Grabber Guide. It helps you capture campaign attribution on checkouts, orders, quote requests, and ecommerce conversions and keep the marketing context needed for accurate reporting across forms, bookings, signups, and sales.

### Enable Ecommerce Tracking in Google Analytics
You should enable this in your Google Analytics account. Information how to do it can be found [here](https://support.google.com/analytics/answer/1009612?hl=en)

### Configure Google Analytics Webhook in HandL UTM Grabber
We have a preloaded configuration that will allow you to send UTMs or event data to Google Analytics as soon as a status of order change in WooCommerce (payment_complete, order_status_pending, order_status_failed, order_status_on-hold, order_status_processing, order_status_completed, order_status_refunded, order_status_cancelled)

[![configure-woocommerce-google-analytics-webhook.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/configure-woocommerce-google-analytics-webhook.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/configure-woocommerce-google-analytics-webhook.png)

### Select WHEN to send data to Google Analytics
We recommend sending the data to Google Analytics as soon as payment complete. That's why we auto-populate that hook out of the box. You can configure the other fields the same way. 

[![select-when-to-fire-the-event.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/select-when-to-fire-the-event.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/select-when-to-fire-the-event.png)

### Setup the data you want to send it to Google Analytics
You can use HandL URL builder to configure your fields easier. Click the icon next to the input field shown in the image below.

[![handl-url-builder-icon.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/handl-url-builder-icon.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/handl-url-builder-icon.png)

To remove a paramater from the payload, click the red remove icon. To add a new parameter click "+ Add New Parameter" button at the bottom. To save the progrees, click "Save" like shown in the image below.

[![handl-url-builder-remove-add-save.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/handl-url-builder-remove-add-save.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/handl-url-builder-remove-add-save.png)

#### Replace tid to your tracking ID
First replace tid to your tracking ID (UA-XXXXX-X)

[![replace-tid-to-your-trackingid.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/replace-tid-to-your-trackingid.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/replace-tid-to-your-trackingid.png)

#### Configure your data
You can send almost any data that generated in WooCommerce to Google Analytics. There are few rules to follow. We configured the few fields out of the box for you. However you can add your own field in addition to this.

Pay attention to the value key pairs that is specific to Google Analytics. You can find more information [here](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cm)

If you need to cast/format a variable into string, integer or float simply add `(int)`, `(str)` or `(float)` before your variable. This is especially required for Event Value field as shown below. 

```
v=1&
t=event&
tid=UA-XXXXX-X&
cid=wc|data__customer_id&
ti=wc|data__order_key&
tr=wc|data__total&
tt=wc|data__total_tax&
ts=wc|data__shipping_total&
tcc=COUPON&
pa=purchase&
pr1id=wc|product__id&
pr1nm=wc|product__name&
pr1qt=1&
pr1pr=wc|data__total&
ni=1&
cu=USD&
cn=wc|meta__utm_campaign&
cs=wc|meta__utm_source&
cm=wc|meta__utm_medium&
ck=wc|meta__utm_keyword&
cc=wc|meta__utm_content&
ec=HandLEventCat&
ea=HandLEventAction&
el=HandLEventLabel&
ev=(int)wc|data__total
```

In addition to that;

You can send/track/collect any WooCommerce order data parameters as follows:
```
wc|data__status //order status
wc|data__currency //order currency
wc|data__discount_total //order total discount
wc|data__shipping_total //order total shipping
wc|data__total //order total
wc|data__total_tax //order total tax
wc|data__customer_id //order custom id
wc|data__order_key //order id
wc|data__billing__first_name //order customer first name
wc|data__billing__last_name //order customer last name
wc|data__billing__address_1 //order customer address
wc|data__billing__city //order customer city
wc|data__billing__state //order customer state
wc|data__billing__postcode //order customer postalcode
wc|data__billing__email //order customer email address
wc|data__billing__phone //order customer phone number
wc|data__payment_method //order method of payment (e.g. card, cash etc)
```

You can send/track/collect any WooCommerce order meta data parameters as follows:
```
wc|meta__gclid
wc|meta__utm_campaign
wc|meta__utm_source
wc|meta__utm_medium
wc|meta__utm_terms
wc|meta__utm_content
wc|meta__handl_original_ref
wc|meta__handl_landing_page
wc|meta__handl_ref
wc|meta__organic_source
wc|meta__first_gclid
wc|meta__first_utm_campaign
wc|meta__first_utm_source
wc|meta__first_utm_medium
wc|meta__first_utm_terms
wc|meta__first_utm_content
```

You can send/track/collect any WooCommerce product data parameters as follows:
```
wc|product__name
wc|product__product_id
wc|product__variation_id
wc|product__quantity
wc|product__total
wc|product__total_tax
```

### The data will be populated in your Google Analytics
Once an order placed and an event satisfied (payment completed), HandL UTM Grabber post the order data (configured above) to Google Analytics. You will be able to access the data in Google Analytics like this.

#### You can measure the performance of the campaign (based on revenue)

[![google-analytics-campaign-view.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/google-analytics-campaign-view.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/google-analytics-campaign-view.png)

#### You can measure the performance of the campaign based on Source/Medium

[![google-analytics-source-medium.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/google-analytics-source-medium.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/google-analytics-source-medium.png)

#### Transaction information is available under user explorer for each user

[![google-analytics-report.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/google-analytics-report.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/google-analytics-report.png)

#### UTM data is also available under sales performance

[![google-analytics-sales-performance.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/google-analytics-sales-performance.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/google-analytics-sales-performance.png)

#### If you have sent event parameters (such as Event Category, Event Action, Event Label, Event Value) shown above, you will see them populated in Google Analytics

[![google-analytics-event-category-table-valeu.png](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/scaled-1680-/google-analytics-event-category-table-valeu.png)](https://docs.utmgrabber.com/uploads/images/gallery/2020-08/google-analytics-event-category-table-valeu.png)