# Click Tracking With Javascript SDK This article describes how to track click events with JavaScript SDK. * [Prerequisites](/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/click-tracking-with-javascript-sdk#prerequisites) * [Tracking Clicks on Links](/products/customer-data-platform/integration-hub/streaming/td-javascript-sdk/click-tracking-with-javascript-sdk#tracking-clicks-on-links) ## Prerequisites * Basic knowledge of JavaScript and HTML. * Basic knowledge of Treasure Data. * Basic knowledge of Treasure Data JavaScript SDK. Treasure Data recommends you verify the implementation of any new features or functionality at your site using the Treasure Data JavaScript SDK version 3 before you start using it in production. It manages cookies differently. Be aware when referring to most of these articles that you need to define the suggested event collectors and Treasure Data JavaScript SDK version 3 calls in your solutions.For example, change //cdn.treasuredata.com/sdk/2.5/td.min.js to //cdn.treasuredata.com/sdk/3.0.0/td.min.js. # Tracking Clicks on Links When you have links to external sites on which you can not track pageview and would like to track which link the user clicked, 1. Track click actions by calling *trackEvent* function in link-tag using *onClick*. 2. The following example sends the default tracking data and link_url data to *pageviews* table when the user clicks the link. 3. Optionally, review [Google Tag Manager](https://docs.treasuredata.com/smart/project-integrations/google-tag-manager-import-integration). ```html
Hello Treasure Data! link1 link2 link3 ```