How to add ClickTag to InBanner Video?.

Hits: 183

How to add ClickTag to InBanner Video?.

It’s very easy concept to add click URL to the video ads using Javascript.

Follow the below steps to add ClickTag on Inbanner Video:

1.) Add video id (videoclick) to the video tag

<video id=”videoclick” width=”400″ height=”300″ controls autoplay></video>

2.) Then Add onclick function using Javascript as below,

<script type=”text/javascript”>
document.getElementById(“videoclick”).onclick = function()
{
window.open(“http://www.google.com”);
};
</script>

3.) Here you go with full code,
<html> 

<body>

<video id="videoclick" width="400" height="300" controls autoplay>
<source src="https://pragmaticwebmedia.com/wp-content/uploads/2018/07/mov_bbb.mp4" type="video/mp4">
</video>

</body> 
</html>

<script type="text/javascript">
document.getElementById("videoclick").onclick = function()
{
window.open("http://www.google.com");
};
</script>

 

Run your code here. Realtime Editor

Hope this post helps..

Thank You!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.