User Tagging

Info For more detailed information and a complete list of special & predefined properties see here the properties page.

Just (1) add the following snippet to the page where you collect the email value, and (2) replace the data in the javascript function.

<script>
// define an empty variable called 'map'
var map = new OTMap();

//define email variable to be send to Opentracker
map.put("email", "john.doe@example.com");

//send (submit) the data to Opentracker
OTLogService.sendEvent("email logged", map); 
</script>
Important Make sure you replace "john.doe@example.com" with your (dynamically) generated email

You will need to replace "john.doe@example.com" with the real data. This can be done in various ways with all types of programming languages.

Pageviews & duration

Sending events to Opentracker's events engine with javascript automatically updates the state of the session and the users with the OTLogService.sendEvent() function. The state is updated in the user interface for the user and the sessions. In most cases this is what you want, the sendEvent() function will automatically update a cookie holding state information, in the same way a normal page-view does. For some events you may want to turn off this default functionality, which is accomplished by adding a false value to the OTLogService.sendEvent() function:

OTLogService.sendEvent("title", map, false); 

 

Examples follow, please leave a comment if you have suggestions or improvements for this page.

Parsing from url

Scenario: your target users land on a specific landing page, and you are able to append the email address or user id to the URL like this:

http://www.mysite.com/mypage.html?email=user@domain.com

Using various languages you can now grab this email address and pass the data to us.

Below are some examples of commonly used languages as javascript, PHP, JSP

Javascript example

<script type="text/javascript">

        // jquery document ready 
        $(document).ready(function() {
        
        // javascript function to get (multiple) variables from url
        function getQueryVariable(variable)
        {
                var query = window.location.search.substring(1);
                var vars = query.split("&");
                for (var i=0;i<vars.length;i++) {
                       var pair = vars[i].split("=");
                       if(pair[0] == variable){return pair[1];}
                }
                return("");
        }
        
        // define an empty variable called 'map'
        var map = new OTMap();
         
        // grab the email from the url
        var email = getQueryVariable("email");
         
        
        //define email variable to be send to Opentracker
        map.put("email", email);
         
        //send (submit) the data to Opentracker
        OTLogService.sendEvent("email logged", map, false); 
         
        
        });
</script>

php example

use $_GET to parse the url variable to a php variable

<?php 
        /* grab the email from the url */
        $email = $_GET["email"]; 
?>      

Use the following javascript and populate the email value in the javascript

<script type="text/javascript">

// define an empty variable called 'map'
var map = new OTMap();

//define email variable to be send to Opentracker
map.put("email", "<?php echo $email ?>");

//send (submit) the data to Opentracker
OTLogService.sendEvent("email logged", map, false); 

</script>

jsp example

// grab the email from the url
String email = request.getParameter("email");

Use the following javascript and populate the email value in the javascript

<script type="text/javascript">

// define an empty variable called 'map'
var map = new OTMap();

//define email variable to be send to Opentracker
map.put("email", "<%= email %>");

//send (submit) the data to Opentracker
OTLogService.sendEvent("email logged", map, false); 

</script>

Event count:

Calling this function will update the event count in the cookie with +1 and update the timestamps, just like a normal page-view would.

For some event types you may want to turn off this default functionality, which you can do by setting the last parameter to false.

OTLogService.sendEvent("some title", map, false); 

Requirements:

  • The Opentracker tracking javascript needs to be in the page and loaded before you submit the custom events.

Other event types:

We have pre-defined a number of event types, for example user-tagging, video, audio, download, print, etc. The list is growing . See the list of event types here

Sending custom events such as user or email data to Opentracker's events engine, can be done by using a simple javascript function.

Q: What does this mean in practice? 
A: This means that you can see user name, account holder, email address, user ID, etc in clickstreams, and search on them. 

All you have to do is send us an event signal.