-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappcues_test3_no_integration.html
60 lines (46 loc) · 2.84 KB
/
appcues_test3_no_integration.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
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<title>Appcues test page</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"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t,e){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src="https://cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a);analytics._loadOptions=e};analytics.SNIPPET_VERSION="4.1.0";
analytics.load("f0mkFrd38lR8LW97t73odW9VkiQP532m", { integrations: {'Appcues': false}});
}}();
</script>
<script src="//fast.appcues.com/56478.js"></script>
<script>
analytics.on('track', function(event, properties, options) {
// need to ensure there is a userId, otherwise don't try and fire a identify call to Appcues
// 'event' contains the event name, e.g. "Button Clicked"
// 'properties' contains the event properties, e.g. "link_text:'click me'"
if(window.Appcues && analytics.user().id() && event)
{
window.Appcues.track(event, properties);
}
});
analytics.on('identify', function(event, properties, options) {
// need to ensure there is a userId and an event name, otherwise don't try and fire a track event to Appcues
// 'event' contains the userId, e.g. "user_00001"
// 'properties' contains the user traits, e.g. "first_name:'Joe'"
if(window.Appcues && analytics.user().id() && event)
{
window.Appcues.identify(event, properties);
}
});
analytics.on('page', function(event, properties, options) {
// need to ensure there is a userId and a page name, otherwise don't try and fire a page event to Appcues
// 'properties' contains the page name
// 'options' contains the page event properties, including url, querystring and any other custom properties
if(window.Appcues && analytics.user().id() && properties)
{
window.Appcues.page(properties, options);
}
});
</script>
</head>
<body>
<h1>Appcues test page</h1>
<p>This page doesn't load Appcues through Segment. Instead Appcues is natively installed. However whenever a Segment event is fired we'll invoke an Appcues track, identify or page event via an analytics.on call</p>
<p>To test this, just fire page, track or identify calls from the Chrome console</p>
</body>
</html>