Enhanced Link Attribution is a important feature of Google Analytics. It is helps you to understand performance of different sections, links and buttons on your WooCommerce Website. For any WooCommerce Store understanding of users interaction with store is always beneficial and help to improve converstion rate of website. With use of Enhanced Link Attribution you can track performance of different sections, buttons and links on your website. This feature differentciate indentical looking links and buttons your website and also capture different interactions of visitors along with.
For example:- If you have two action or go to buttons on your landing page. this feature can help you to understand which button received more clicks compare to other.
For getting report and data generated with this feature you will need to add extension in your brower called Page Analytics (by Google) This extension will help you to understand interactions of Users on different page and numbers of clicks different links and buttons received.
This extension only shows data for personal websites which you have access in google analytics account. Along with that you also need to enable this feature in your Google Analytics tracking code as well.
Now let’s talk how to set up this feature on your WooCommerce Website. You can choose either Advanced WC Analytics Plugin or Manually add Tracking code with enabled Enhanced Link Attribution feature.
![Enhanced-Link-Attribution-Plugin-Settings Enhanced Link Attribution Plugin Settings](https://advancedwcanalytics.com/wp-content/uploads/2021/03/Enhanced-Link-Attribution-Plugin-Settings.png)
Setup Enhanced Link Attribution in WooCommerce Website Using Plugin
First of all you need to connect WooCommerce Website with your Google Analytics Account . Once you complete this step, Please go to Tracking Settings tab of plugin settings. Here you find checkbox with label Use Enhanced Link Attribution click to check that box and hit Save Tracking Options save chnages you have just performed. Now onward plugin will start collecting data for various interactions of Users with your website sections, buttons and links. You can see that data on website using browser extension we discussed earlier.
This functionality is working for both Universal Analytics and Google Analytics Version 4. So base on version of your Google Analytics Advanced WC Analytics Plugin will make necessary changes in code to send require information associated with Enhanced Link Attribution Feature.
Setup Enhanced Link Attribution in WooCommerce Website Using gtag.js and WordPress Hook.
You can setup Enhanced Link Attribution in WooCommerce website using wordpress core hook & gtag.js. In this example we are adding tracking code in website header using wp hook. You need to put following code by replacing your tracking/measurement id in your theme functions.php file. Make sure that you put this snippet only once on your website otherwise you will recive duplicate impressions of pageview and events.
add_action('wp_head','goolge_wc_analytics'); function goolge_wc_analytics() { ?> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=TrackingID/MeasurementID"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'TrackingID/MeasurementID', {'link_attribution':true}); </script> <?php }