# Google Ads Conversion Tracking | Conversion Value

**URL:** <https://community.piwik.pro/t/google-ads-conversion-tracking-conversion-value/2875>\
**Category:** Data collection and tags\
**Created:** [September 11, 2023, 11:34am UTC](https://community.piwik.pro/t/google-ads-conversion-tracking-conversion-value/2875 "2023-09-11T11:34:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juergen](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/juergen/32/752_2.png) [@Juergen](https://community.piwik.pro/u/Juergen)\
**Post date:** [September 11, 2023, 11:34am UTC](https://community.piwik.pro/t/google-ads-conversion-tracking-conversion-value/2875/1 "2023-09-11T11:34:36Z")

</div>

Dear Piwik PRO-Community,

Thanks to the great support of @pslonina since Oct. 22 we’ve already a working tag for E-Commerce-Tracking in Piwik PRO. It extracts the values from an existing DL and looks like follows:

```auto
<script>
var _paq = _paq || [];
(function () {
var ecObject = {{ ecommerce }}
var products = {{ ecommerce }}.items
products.forEach(function(product){
_paq.push(["addEcommerceItem", product.item_id, product.item_name, product.item_category, product.price, product.quantity]);
});
_paq.push(["trackEcommerceOrder", ecObject.transaction_id, parseFloat(ecObject.value),, parseFloat(ecObject.tax), parseFloat(ecObject.shipping),]);
})();
</script>

```

Now I’d like to implement Conversion Tracking for Google Ads. To send not only the conversion but also the conversion value to Google Ads I’ve set a variable for “Conversion value” in this tag.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/d/d0c19fe7bfb240295c93ed6ab08f6bc41976e3d6.png)

Now I need a script to extract the "Conversion value“ into this variable.

I’ve already tried to follow the instructions of @kuba (see [How to track revenue for Google Ads - #5 by myvetshop](https://community.piwik.pro/t/how-to-track-revenue-for-google-ads/1506/5)), but unfortunately I’m not that familiar with JS.

Can you be of assistance? That’d be great!

Best regards

Jürgen

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [September 11, 2023, 12:11pm UTC](https://community.piwik.pro/t/google-ads-conversion-tracking-conversion-value/2875/2 "2023-09-11T12:11:26Z")

</div>

Hi @Juergen,

From what I see the order value is hidden in your case under `{{ ecommerce }}.value`.  
Try custom JS variable like this:

```auto
function(){
    try{
        return {{ ecommerce }}.value;
    }catch{
        return null;
    }
}

```

in case that doesn’t work you just have to figure out where the revenue is hidden in the dataLayer for ecommerce and change `.value` to wherever the correct value is.

Also, your current solution uses outdated methods for tracking ecommerce, I’d recommend trying out our new ecommerce methods and tags. Here is an article about that [Big changes in ecommerce: what's new and how to update your current tracking | Piwik PRO help center](https://help.piwik.pro/support/collecting-data/big-changes-in-ecommerce-whats-new-and-how-to-update-your-current-tracking/)

(older ones still work, it’s more about how simple it is to use new ecommerce tags and how much more in-depth you can go with new product dimensions)

Best,  
Oliwer

---

<div class="post-metadata">

**Author:** ![Juergen](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/juergen/32/752_2.png) [@Juergen](https://community.piwik.pro/u/Juergen)\
**Post date:** [September 11, 2023, 1:03pm UTC](https://community.piwik.pro/t/google-ads-conversion-tracking-conversion-value/2875/3 "2023-09-11T13:03:28Z")

</div>

Hi @Oliwer_Kaczmarek ,

Many thanks for your feedback 👍

Looks good! In Tracker debugger I see the variable “Purchase revenue” filled with the purchase revenue.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/0/0da003b315ed763f9f9b27421ae967be5a25c8ab.png)

Best,

Jürgen
