0.1.6 • Published 10 months ago

opalizer-js v0.1.6

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
10 months ago

Opalizer JS SDK

Prerequisite

  1. API KEY
  2. 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/opalizer-js@0.1.5/dist/opalizer-js.min.js"></script>
<script type="text/javascript">
    opsda.init({
        endpoint: "{endpoint}",
        key: "{api-key}"},
        function (tracker) {
            tracker.send();
        }
    );
</script>

</html>

Examples

  1. 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.

  1. 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.

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago