-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtito-facebook-pixel-example.html
48 lines (40 loc) · 1.55 KB
/
tito-facebook-pixel-example.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
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<head>
<title>Tito Sample Event Tracking</title>
<script src="https://js.tito.io/v1"></script>
<script>
var facebook_pixel_id = 'XXX'
</script>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', facebook_pixel_id);
</script>
<!-- End Facebook Pixel Code -->
<script>
Tito.on('event:landing', function(data){
})
Tito.on('registration:started', function(data){
var facebook_pixel_id = 'XXX'
var conversion = document.getElementById('conversion').innerHTML
noscript.innerHTML = conversion
document.querySelectorAll('body')[0].appendChild(script)
document.querySelectorAll('body')[0].appendChild(noscript)
})
Tito.on('registration:filling', function(data){
})
Tito.on('registration:finished', function(data){
})
Tito.on('registration:complete', function(data){
});
</script>
<script type="text/html" id="conversion">
<img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=427731834101286&ev=PageView&noscript=1"
/>
</script>
</head>