-
Notifications
You must be signed in to change notification settings - Fork 3
/
vimeo.html
38 lines (35 loc) · 2.29 KB
/
vimeo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=700,maximum-scale=1.0,user-scalable=yes">
<title>Vimeo</title>
<script>
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var key=analytics.methods[e];analytics[key]=analytics.factory(key)}analytics.load=function(key,e){var t=document.createElement("script");t.type="text/javascript";t.async=!0;t.src="https://cdn.segment.com/analytics.js/v1/" + key + "/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n);analytics._loadOptions=e};analytics._writeKey="30t6DSp4jMg8gMmr20XP3EEuuXzPKtS4";analytics.SNIPPET_VERSION="4.13.2";
analytics.load("30t6DSp4jMg8gMmr20XP3EEuuXzPKtS4");
analytics.page();
}}();
</script>
</head>
<body>
<div class="wrapper">
<hgroup>
<h1>Vimeo Segment Example</h1>
</hgroup>
<div class="container">
<div>
<h2>Vimeo Player 1</h2>
<iframe src="https://player.vimeo.com/video/540615810" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<script src="https://player.vimeo.com/api/player.js"></script>
<script>
var iframe = document.querySelector('iframe');
var player = new Vimeo.Player(iframe);
analytics.ready(function () {
var VimeoAnalytics = window.analytics.plugins.VimeoAnalytics
var vimeoAnalytics = new VimeoAnalytics(player, 'XXXXXXX') //WITHOUT THE ACCESS TOKEN THE EVENTS WILL NOT HAVE VIDEO CONTENT INFO (description, title..)
vimeoAnalytics.initialize()
})
</script>
</div>
</div>
</body>
</html>