Visitor-Parser-JS

Visitor Parser JS

View on GitHub

Lightweight javascript-based to analyze visitors with user-agent & ip geo location parser.

Script Features:

The object gives you access to a wide range of data on each "geo" & "ua":

    Usage

    Default:

    visitorParser(function(data) {
        console.log(data);
    });

    With Configuration:

    var config = {
        // set user-agent string
        setUa: 'Mozilla/5.0 (Linux; U; Android 2.3.5; de-de; SAMSUNG GT-S5830/S5830BUKS2 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', 
        // get all options result of regex
        getOpt: true, 
        // set url ip geo location apis
        geoAPI: 'http://freegeoip.net/json/' 
    };
    visitorParser(config, function(data) {
        console.log(data);
    });

    Demo

    Result user-agent string

    
    								

    Results of pasrser