Link click callback

Instapage allows running javascript code just after anchor or button click. 

1. Any link click on the page

Use the following snippet if you want your code to be executed upon any button click on the page, regardless of element ID. 

NOTE: The "instapageAnchorClick" function can only be present on the page once, regardless of how many buttons you have or how many actions you want to trigger after the click. In case you have multiple snippets that need to fire upon the click, you must add all of them under the same Link click Callback function. If the snippets are not added under the same Link click Callback script, only the last function in the source code will be triggered.

2. A click on a particular element

Use the following snippet if you want your code to be executed upon clicking a specific element, targeted by its unique ID.

Here you will need to replace "123" with the actual ID of your element. The GIF below demonstrates how you can find it:

GIF showing how to replace the ID of your element