Segment click event tracking



I’m using Segment ( 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?