analytics.js uses trackers to send data to Google Analytics and hit types to specify the types of the data.
Unlike analytics.js, gtag.js doesn't use trackers to send data to Google Analytics. It sends data to Google Analytics properties identified by their tracking IDs set by the config command. The event names supplied to gtag.js specify the types of data being sent to Google Analytics.
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=[@REFERRAL_KEY1@]"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '[@REFERRAL_KEY1@]'
[%if [@CONFIG:CHECKOUT_COMPLETED@] %], {'page_title' : 'Invoice', 'page_path': '/purchase/invoice.html' }
[%elseif [@CONFIG:GA_FUNNEL_VALUE@]%]%], {'page_path': '[@CONFIG:GA_FUNNEL_VALUE@]' }
[%/if%]);
</script>
<!-- Start Google Purchase Tracking -->
[%set [@ga_cart_items@]%]0[%/set%]
[%show_order id:'[@order_id@]'%]
[%param *header%]
<script type="text/javascript">
gtag('event', 'purchase', {
'transaction_id': '[%escape%][@order_id@][%/escape%]', // Transaction ID. Required.
'affiliation': '[%escape%][@CONFIG:WEBSITE_NAME@][%/escape%]',
'value': '[@grand_total@]',
'currency': '[@CONFIG:DEFAULTCURRENCY@]',
'tax': '[@tax_total@]',
'shipping': '[@shipping_price@]',
'items': [
[%/ param%]
[%param *body%]
[%set [@^ga_cart_items@]%][%calc [@ga_cart_items@] + [@qty@]/%][%/set%]
{
'id': '[%escape%][@sku@][%/escape%]', // SKU. Required.
'name': '[%escape%][@model@][%/escape%]',
'category': '[%escape%][@CATEGORY_NAME@][%/escape%]',
'price': '[@price@]',
'quantity': '[@qty@]'
}[%if [@^ga_cart_items@] < [@^total_items@]%],[%/if%]
[%/ param%]
[%param *footer%]
]
});
</script>
[%/ param%]
[%/ show_order%]
<!-- End Google Purchase Tracking -->