What is the most convenient plugin with woocommerce to transfer product data to Google Analytics?

Could you tell me which plugin to link Google Analytics with woocommerce.
Need to pass the data about the ordered products:
unique transaction ID
Item ID
the total purchase price
item name
the price of the goods
the quantity of goods
June 10th 19 at 15:16
3 answers
June 10th 19 at 15:18
Solution
Thank you) - Darrion.Wintheiser50 commented on June 10th 19 at 15:21
June 10th 19 at 15:20
The solution above was good.But an hour of digging in the documentation google has found an alternative.Just lay it out here.Maybe someone will be useful.

Perfect for those who are not afraid to go into the code of wordpress

Code should be placed in the file functions.php

devise_wc_ga_integration function( $order_id ) {
 $order = new WC_Order( $order_id ); ?>

 <script type="text/javascript">
 ga('require', 'ecommerce', 'ecommerce.js'); 


 ga('ecommerce:addTransaction', {
 'id': '<?php echo $order_id;?>',
 'affiliation': '<?php echo get_option( "blogname" );?>',
 'revenue': '<?php echo $order->get_total();?>',
 'shipping': '<?php echo $order->get_total_shipping();?>',
 'tax': '<?php echo $order->get_total_tax();?>',
 'currency': '<?php echo get_woocommerce_currency();?>'
});


<?php

 if ( sizeof( $order->get_items() ) > 0 ) {
 foreach( $order->get_items() as $item ) {
 $product_cats = get_the_terms( $item["product_id"], 'product_cat' );
 if ($product_cats) { 
 $cat = $product_cats[0];
 } ?>
 ga('ecommerce:addItem', {
 'id': '<?php echo $order_id;?>',
 'name': '<?php echo $item['name'];?>',
 'sku': '<?php echo get_post_meta($item["product_id"], '_sku', true);?>',
 'category': '<?php echo $cat->name;?>',
 'price': '<?php echo $item['line_subtotal'];?>',
 'quantity': '<?php echo $item['qty'];?>',
 'currency': '<?php echo get_woocommerce_currency();?>'
});
<?php
 } 
 } ?>
ga('ecommerce:send');
</script>
<?php }
add_action( 'woocommerce_thankyou', 'devise_wc_ga_integration' );</code-->
June 10th 19 at 15:22
And more to do nothing?
Yes, the statistics for orders is displayed correctly. - Darrion.Wintheiser50 commented on June 10th 19 at 15:25
I also added f this file this code, but Analytics in e-Commerce, no sales. On the website is the following script
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-********"></script>
the <script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag('js', new Date());

 gtag('config', 'UA-*********');
</script>
- Darrion.Wintheiser50 commented on June 10th 19 at 15:28
,
I've been there too.
We definitely need to have filled in all the fields

'name': '',
'sku': '',
'category': 'name;?>',
'price': '',
'quantity': '',
'currency': ''

I for example would not display until I screwed the individual id of the sku for each product. - nikita.Stracke commented on June 10th 19 at 15:31
And where is the data screwed? I am a novice in these matters. Thought wow commerce itself will do - Darrion.Wintheiser50 commented on June 10th 19 at 15:34
,
in the product.
Sku is the SKU, go in item/inventory, and enter it.
the article should be left.All other parameters can change.
For example, if you dimension do not need to display a category just take it away.

'name': '',
'sku': '',
'category': 'name;?>',
'price': '',
'quantity': '',
'currency': '

The same shall stand or in the header or footer Analytics code that Google gives.
and the code that I described above in a theme file function.php - nikita.Stracke commented on June 10th 19 at 15:37
I have a dimension code like this:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-********"></script>
the <script>
 window.dataLayer = window.dataLayer || [];
 function gtag(){dataLayer.push(arguments);}
 gtag('js', new Date());

 gtag('config', 'UA-*********');
</script>
- Darrion.Wintheiser50 commented on June 10th 19 at 15:40
e-Commerce need a different script? - nikita.Stracke commented on June 10th 19 at 15:43
this and need. - nikita.Stracke commented on June 10th 19 at 15:46

Find more questions by tags WooCommerceWordPressGoogle Analytics