The EuroCMS Core Analytics component

This will use the get_browser(); php function with browscap data, for user agent information, and ipinfo.io for the IP information.

Provides way to get metrics regarding visitors and their browsers.

IPinfo.io and the user agent is parsed to provide detailed information, for developers and marketing alike.

GDPR Rules

  1. Audit Your Data for Personally Identifiable Information (PII)

  2. Turn on IP Anonymization.

  3. Audit your Collection of Pseudonymous Identifiers (hashed Emails, User IDs)

  4. Update your Privacy Policy.

  5. Build an Opt In/Out Capability.

IPinfo.io

ECMS use ipinfo.io for the retrieval of IP information.

"Free usage of our API is limited to 50,000 API requests per month. If you exceed that limit, we'll return a 429 HTTP status code to you." - ipinfo.io, developer, Rate Limits

The IP that makes the request is counted. If that IP address has made 50,000 requests, then that IP gets the 429 HTTP status code.

To round out those request, that comes to 1785.71+- per day. Most websites, are not close to 10,000 per month. For the high volume websites, we will also support the payed version of IPInfo.io.

Below is the data that the free version outputs. All of the below data are also available as a PHP constant. This is done to reduce the requests made to IP info.

  1. ipinfo_ip - Hide this from the developers? Privacy purposes?

  2. ipinfo_hostname

  3. ipinfo_city

  4. ipinfo_region

  5. ipinfo_country

  6. ipinfo_loc

  7. ipinfo_org

  8. ipinfo_postal

  9. ipinfo_timezone

  10. ipinfo_readme

keyvalue
IPIP ADRESS(Will be encrypted in the stable version)
hostnameThe reverse ip of the hostname
cityCity name
regionRegion
countryCountry short code
locAltitude, Longitude
orgISP
postalPostal code
timezoneEurope/Amsterdam
readmehttps://ipinfo.io/missingauth

The Full output json file

The paid plans provides the following data. The IP info used is from a google owned IP. google.com:

{
  "ip":"142.250.72.110",
  "hostname":"lga34s32-in-f14.1e100.net",
  "city":"New York City",
  "region":"New York",
  "country":"US",
  "loc":"40.7143,-74.0060",
  "org":"AS15169 Google LLC",
  "postal":"10004",
  "timezone":"America/New_York",
  "asn":{
    "asn":"AS15169",
    "name":"Google LLC",
    "domain":"google.com",
    "route":"142.250.0.0/15",
    "type":"business"
  },
  "company":{
    "name":"Google LLC",
    "domain":"google.com",
    "type":"business"
  },
  "privacy":{
    "vpn":false,
    "proxy":false,
    "tor":false,
    "relay":false,
    "hosting":false,
    "service":""
  },
  "abuse":{
    "address":"US, CA, Mountain View, 1600 Amphitheatre Parkway, 94043",
    "country":"US",
    "email":"network-abuse@google.com",
    "name":"Abuse",
    "network":"142.250.0.0/15",
    "phone":"+1-650-253-0000"
  },
  "domains":{
    "ip":"142.250.72.110",
    "total":4,
    "domains":[
      "bitechnologies.ng",
      "ratscraps.com",
      "raaatscraps.com",
      "raatscraps.com"
    ]
  }
}

browscap

Next to that, we also provide php constant of browscap variables: https://browscap.org/.

Please view http://browscap.org/ua-lookup for an example output of the data, and also check the wiki page, for detailed examples on the data https://github.com/browscap/browscap/wiki

You can use the ECMS function __ecms_UserAgent(). Which will put all the browscap data in a PHP constant, which you can use later on.

Note:

  1. Please read Browser detection using the user agent for when you want to use this feature.

  2. At the time of writing, whatismybrowser.com, states that there are 184.934.645 user agents. browscap does *not* have all of them listed.

Be aware of this when developing code around the assumption that browscap always provides data.

Example data:

KeyValue
parentFirefox 100.0
commentFirefox 100.0
browserFirefox
browser_typeBrowser
browser_bits64
browser_makerMozilla Foundation
browser_modusunknown
version100.0
majorver100
minorver0
platformUbuntu
platform_versionunknown
platform_descriptionUbuntu Linux
platform_bits64
platform_makerCanonical Foundation
alphafalse
betafalse
win16false
win32false
win64true
framestrue
iframestrue
tablestrue
cookiestrue
backgroundsoundsfalse
javascripttrue
vbscriptfalse
javaappletstrue
activexcontrolsfalse
ismobiledevicefalse
istabletfalse
issyndicationreaderfalse
crawlerfalse
isfakefalse
isanonymizedfalse
ismodifiedfalse
cssversion3
aolversion0
device_nameLinux Desktop
device_makerunknown
device_typeDesktop
device_pointing_methodmouse
device_code_nameLinux Desktop
device_brand_nameunknown
renderingengine_nameGecko
renderingengine_version100.0
renderingengine_descriptionFor Firefox, Camino, K-Meleon, SeaMonkey, Netscape, and other Gecko-based browsers.
renderingengine_makerMozilla Foundation

code

class analytics {

	function __construct() {
    	## do something at class start?
    	## dependency check?
    }

	public function get_browser() {}
	public function IPInfo() {}
	public function Save() {}

	function __desctruct() {
    	## do something after class finish.
    }
}

Reference