1. Home
  2. Developer Documentation & APIs
  3. Player Analytics JS API – Passing User Info

Player Analytics JS API – Passing User Info

Using the Cincopa platform not only has great features but also helps its users to get access with a wide variety of API’s that they can use with our help.

The API’s provided by Cincopa will help them to use all the features of Cincopa and customize it to match their website needs.

In this article, we will discuss the Analytics JS API – Passing User Info, which is helpful to gather specific users access to your media.

Why use Analytics JS API – Passing User Info?

Customer’s such as Subscription websites and SaaS Platforms who has their viewer’s information can pass the viewer Email (or other types of unique id if privacy is a concern) as well as his first and last name (optional) to have that information available on the Cincopa Analytics and Viewing Reports.

Another example, when you have your own login system and you want to be able to track your users by Name/Email/acc_id on Cincopa analytics can then just add this line of code that set cincopa.analytics.

The user data you set will be sent with every video view to Cincopa, that way later you can access the analytics and search for a view of a specific user.

How to use Analytics JS API – Passing User Info?

Firstly, we have to use the HTML code mentioned below and then add them to your website.

HTML Code:

This HTML code will display on your Cincopa Gallery.

<div id=”cp_widget_1539590707155″>…</div>

Analytics API JavaScript Code:

Next, we have to add this JavaScript script tag so we can gather the name and email account.

As per your company website you should be able to gather the name, email, id then pass it onto cincopa.analytics. In the example, below we have added it manually.

<script type=”text/javascript”>

var cincopa = cincopa || {};

cincopa.analytics = {email:”john@debug.com”,name:”John Doe”,acc_id:”123456″};

</script>

You will find this code by clicking on the embed option on your Cincopa Gallery.

To find the embed code, follow these steps:

Log in to your Cincopa account by accessing https://www.cincopa.com and then click on Galleries.

Now click on the Embed button as shown in the screenshot below.

Now simply copy the embed code and use it with the API

<div id=”cp_widget_d7f96856-cd69-4ce7-9985-de8136988193″>…</div><script type=”text/javascript”>

var cpo = []; cpo[“_object”] =”cp_widget_d7f96856-cd69-4ce7-9985-de8136988193″; cpo[“_fid”] = “AsDA5ieQsrXp”;

var _cpmp = _cpmp || []; _cpmp.push(cpo);

(function() { var cp = document.createElement(“script”); cp.type = “text/javascript”;

cp.async = true; cp.src = “//www.cincopa.com/media-platform/runtime/libasync.js”;

var c = document.getElementsByTagName(“script”)[0];

c.parentNode.insertBefore(cp, c); })(); </script>

Check analytical data

Once all the above-mentioned codes are added to your website and if a video is played then you will see the analytics data in your Cincopa account.

To check the analytics data, follow these steps:

Log in to your Cincopa account by accessing https://www.cincopa.com and then click on Analytics.

Once you access the Analytics Page, click on Live Feeds and you will see the data of John Doe that we added using the above-mentioned API.

 

Was this article helpful?