Frequently asked questions Custom Code

How do I track an iFrame click?

How do I track an iFrame click?

Examples below require knowledge of Javascript and CSS. Tilda Customer Support does not assist in code-related questions.

Embed the following code:

<script src="https://cdn.rawgit.com/vincepare/iframeTracker-jquery/master/dist/jquery.iframetracker.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($){
$('#rec62590959 iframe').iframeTracker({
blurCallback: function(){
alert("Video played");
}
});
});
</script>

Replace #rec62590959 with the ID of your block.

You can also replace the alert("Video played") with a value to be sent as a goal to Yandex.Metrika: yaCounterXXXXXX.reachGoal('TARGET_NAME')

Was this answer helpful?
Yes
0
No
0
Views: 9284