I have added a custom url to the widget image in the new WP 4.9. Now I want to add an onclick event to the link.
The a tag looks like this
<a href="http://domain.com/this-is-a-page" class="" rel="" target=""></a>
And I want to have it like this
<a href="http://domain.com/this-is-a-page" onclick="ga('send', 'event', 'Sidebar Image', 'Promo Image', 'Clicked');"></a>
How can I do this?