Segment click event tracking


#1

Hi,

I’m using Segment (segment.com) with Unbounce.

I want to track a button click event by pushing the segment code everytime someone presses a button.

analytics.track(‘Clicked CTA’, {
location: ‘header’,
type: ‘button’
});

I know you have to somehow refer to the ID of the button.

Can someone tell me how to do this, please?

Thanks.