How to Capture Events using third party CRM

New Member
3 0 0
Hi Shopify Developer Community,
We are working with one of the CRM companies to auto-capture the events on the website.
We need help with the below-mentioned events, is there any way to do that.
1. Add To Cart Event
=> When “Add To Cart” button clicked on the product detail page and collection page, we need javascript function to be executed
=> For this we need a function to execute a javascript function

2. Purchase Event
=> When the Purchase is complete, a javascript function needs to be executed.
=> For this we need a function to execute javascript functions when a purchase is completed.