opalizer-js
v0.1.6
Published
track it will help to capture user interaction on websites
Downloads
9
Readme
Opalizer JS SDK
Prerequisite
- API KEY
- API Endpoint
Setup
To setup opalizer js sdk, you need to to reference opalizer-js.js
file in your html.
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<h1>This is Sample website </h1>
</body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/opalizer-js.min.js"></script>
<script type="text/javascript">
opsda.init({
endpoint: "{endpoint}",
key: "{api-key}"},
function (tracker) {
tracker.send();
}
);
</script>
</html>
Examples
- Add GA user Id
opsda.init({
endpoint: "http://127.0.0.1:8000/v1/events",
key: "{api key}"},
function (tracker) {
tracker.send(123);
}
);
In this example 123
is a provided GA user Id.
- Add GA user Id & extra information
extra = {"name":"John", "location":"US"}
opsda.init({
endpoint: "{endpoint}",
key: "{api key}"},
function (tracker) {
tracker.send(123, extra);
}
);
In this example 123
is a provided GA user Id and extra
is a an extra information object.