vercel / analytics

Privacy-friendly, real-time traffic insights
https://vercel.com/analytics
Mozilla Public License 2.0
429 stars 26 forks source link

Feature request: More events #20

Closed martinowren closed 1 year ago

martinowren commented 1 year ago

It would be really nice to have events such as GA4 or FB pixel:

edymusajev commented 1 year ago

Yes please, I'm looking for alternative to Google Analytics but the only thing i'm missing with Vercel is that there's no way to track events.

Would be nice to at least know whether or not adding this feature is on the roadmap anytime soon.

timolins commented 1 year ago

Thanks for your feedback! Custom events are on our roadmap and shipping 🔜

tobiaslins commented 1 year ago

Hey :) @martinowren @edehlol

Vercel Web Analytics went just into General Availability with custom events supported! Check out our release post

Install our the latest release of our package npm i @vercel/analytics@^1.0.0

import va from '@vercel/analytics';

function SignupButton() {
  return (
    <button 
      onClick={() => {
        va.track('Signup', {
          location: 'US'
        });
      };
    >
      Sign Up
    </button>
  );
};

Happy to hear what you all think!