Connecting frappe insights to site using API

Hello, I am learning how to use frappe insights. I haven’t figured out how to connect insights to a site using API connection. How can I achieve this?

Check out the documentation and let me know if you face any issues