Arbitrary JavaScript by clicking on the CTA button

You can use the CTA button of Vidwidget service not only to follow links but also to run your own JavaScript logic, for example to open a modal window. To do so, when setting up the widget in your personal account, leave the “Link” field empty.

To intercept a Widget CTA button click, use the document.addEventListener (‘vw-btn-click’, CALLBACK); method, where CALLBACK is your own function.

An example of use, the result of which you can see on the current page:

<script>
	function vw_callback(){
		alert('My action');
	}
	document.addEventListener('vw-btn-click', vw_callback);
</script>



		

Read also

Arbitrary JavaScript by clicking on the CTA button

You can use the CTA button of Vidwidget service not only to follow links but also to run your own…

Widget integration with Google Analytics

To track Widget conversions in the Google Analytics service, go to the administration panel of your site in your Google…

Quick start: installing a video widget on a website

Congratulations on signing up to Vidwidget service. You made the right decision. But what to do next? How to make…