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
-
Audit Your Data for Personally Identifiable Information (PII)
-
Turn on IP Anonymization.
-
Audit your Collection of Pseudonymous Identifiers (hashed Emails, User IDs)
-
Update your Privacy Policy.
-
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.
- Later on we will try to implement MaxMind IP database in EuroCMS: https://www.php.net/manual/en/book.geoip.php
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.
-
ipinfo_ip- Hide this from the developers? Privacy purposes? -
ipinfo_hostname -
ipinfo_city -
ipinfo_region -
ipinfo_country -
ipinfo_loc -
ipinfo_org -
ipinfo_postal -
ipinfo_timezone -
ipinfo_readme
| key | value |
|---|---|
| IP | IP ADRESS(Will be encrypted in the stable version) |
| hostname | The reverse ip of the hostname |
| city | City name |
| region | Region |
| country | Country short code |
| loc | Altitude, Longitude |
| org | ISP |
| postal | Postal code |
| timezone | Europe/Amsterdam |
| readme | https://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:
-
Please read Browser detection using the user agent for when you want to use this feature.
-
At the time of writing, whatismybrowser.com, states that there are
184.934.645user 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:
| Key | Value |
|---|---|
| parent | Firefox 100.0 |
| comment | Firefox 100.0 |
| browser | Firefox |
| browser_type | Browser |
| browser_bits | 64 |
| browser_maker | Mozilla Foundation |
| browser_modus | unknown |
| version | 100.0 |
| majorver | 100 |
| minorver | 0 |
| platform | Ubuntu |
| platform_version | unknown |
| platform_description | Ubuntu Linux |
| platform_bits | 64 |
| platform_maker | Canonical Foundation |
| alpha | false |
| beta | false |
| win16 | false |
| win32 | false |
| win64 | true |
| frames | true |
| iframes | true |
| tables | true |
| cookies | true |
| backgroundsounds | false |
| javascript | true |
| vbscript | false |
| javaapplets | true |
| activexcontrols | false |
| ismobiledevice | false |
| istablet | false |
| issyndicationreader | false |
| crawler | false |
| isfake | false |
| isanonymized | false |
| ismodified | false |
| cssversion | 3 |
| aolversion | 0 |
| device_name | Linux Desktop |
| device_maker | unknown |
| device_type | Desktop |
| device_pointing_method | mouse |
| device_code_name | Linux Desktop |
| device_brand_name | unknown |
| renderingengine_name | Gecko |
| renderingengine_version | 100.0 |
| renderingengine_description | For Firefox, Camino, K-Meleon, SeaMonkey, Netscape, and other Gecko-based browsers. |
| renderingengine_maker | Mozilla 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.
}
}