Getting started with tracking tags but have huge 318kb/65kb file

I wanted to track some button clicks, add some tags in this onlclick. I was wondering why this javascript file is so big. Sending some data to a website, should not require so much code not?

Is there some sort of bare essentials file I can use for the tracking these tags?

Something like this

Hi @f1outsourcing
I think Matomo tracking file (65kb only when used in standard Matomo, because of the minified version) can probably manage more cases than some other trackers:

  • With or without cookie,
  • Consent management,
  • Heartbeat (with sendbeacon + fallbackin case of function unavailable)
  • Content tracking
  • Custom dimensions and Custom variables
  • Device detection
  • Basic Ecommerce tracking
  • Goals tracking
  • Page Performance
  • Links tracking
  • Downloads / Outlinks tracking
  • Queue requests
  • Search tracking
  • Referrers attribution management
  • Resolution tracking
  • Users vs. Unknown visitors tracking
  • Language tracking

Full list of features:
https://developer.matomo.org/api-reference/tracking-javascript

Yes would be better if this was determined on the basis of your configuration. So is there already something like this?