Add an onclick attribute

i did Install the global site tag and also the event snippet,


but when i try to Add an onclick attribute it tell me that the is not defined?


what am i doing wrong?also how i am able to do the tracking on the add to cart, because i am on the “product page” and i am not able to do “on Click”
here is the instruction for adding an onclick attribute with HTML: Add an onclick attribute directly to the code for the button or link you’d like to track. The code you use will depend on how the link or button is displayed on your site: as a text link, button, or button image. Add the code to a button: This code shows you how to add click tracking functionality to a button using the tag. Replace " http://example.com/your-link " with the URL for your website.Submit
please help

better picture:

Hello adir,

You may want to look at how to do work with html components first here : Velo: Working with the HTML iframe Element | Help Center | Wix.com

That is not the correct way to send messages and data to html components, to do that correctly check out this documentation here: HtmlComponent - Velo API Reference - Wix.com

Goodluck!
Majd

Old post from 2018 reappearing, closed.