Icontem

File: examples/example_sync.html

Recommend this page to a friend!
  Classes of Arturs Sosins  >  Countly Web SDK  >  examples/example_sync.html  >  Download  
File: examples/example_sync.html
Role: Documentation
Content type: text/plain
Description: Documentation
Class: Countly Web SDK
Track site accesses and errors the Countly API
Author: By
Last change: Merge pull request #32 from frknbasaran/ga-adapter

[sdk] ga and countly queue implementation.
Date: 4 months ago
Size: 752 bytes
 

Contents

Class file image Download
<html>
<head>
<input type="button" id="testButton" onclick="clickEvent(this)" value="Test Button">
<p><a href='http://count.ly/'>Count.ly</a></p>
<!--Countly script-->
<script type='text/javascript' src='../lib/countly.js'></script>
<script type='text/javascript'>

//initializing countly with params
Countly.init({
	app_key: "YOUR_APP_KEY",
	url: "https://try.count.ly", //your server goes here
	debug:true
})
//track sessions automatically
Countly.track_sessions();
//track pageviews automatically
Countly.track_pageview();
</script>
</head>
<body>
<script type='text/javascript'>
//send event on button click
function clickEvent(ob){
	Countly.add_event({
		key:"buttonClick", 
		"segmentation": {
			"id": ob.id
		}
	});
}
</script>
</body>
</html>