You can use an Event Track type in Analytics to achieve this. You need to create separate triggers and tags to collect this information. To create a new trigger for adding a product to the cart you need to follow the steps below.
Click Triggers > Click New > Click Trigger Configuration > Custom Event type. You need to create an Event Name and add select use regex matching. You need to define this event to match an action when a user adds a product to their cart. Once this is done, you need to create tags that will fire when this event occurs.
You can create Tags by the steps mentioned below.
Click Tags > New > Click Tag Configuration > Google Analytics – Universal Analytics > Set Track Type to Event > Enter Event Tracking Parameters where you select Category – Add to Cart, Action – Select and Label – Buy.
This question is a part of the Assessment 4 section of the Google Tag Manager Fundamentals exam. You can find all the answers to this exam in our Google Tag Manager Fundamentals Assessment Answers page.