Can my App monitor user visits on a store?

I am developing an App, and my client asked me if it’s possible for the app to collect some Analytics ( like monthly user visits, referer sources ).

If it’s not possible to track visits, at least can i get the Referer for an actual order? (whether the buyer came from Facebook Ads, Google, etc. ).

Thanks

SOLVED: https://shopify.dev/api/admin-rest/2022-01/resources/scripttag#post-script-tags