{"id":132,"date":"2020-11-08T22:51:00","date_gmt":"2020-11-08T12:51:00","guid":{"rendered":"https:\/\/fernygroveweather.com\/blog\/?p=132"},"modified":"2020-11-09T22:21:42","modified_gmt":"2020-11-09T12:21:42","slug":"website-analytics","status":"publish","type":"post","link":"https:\/\/fernygroveweather.com\/blog\/2020\/11\/08\/website-analytics\/","title":{"rendered":"Website analytics"},"content":{"rendered":"\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">A <a rel=\"noreferrer noopener\" href=\"\/..\/website-analytics.php\" data-type=\"URL\" data-id=\"\/..\/website-analytics.php\" target=\"_blank\">new page<\/a> is now available that has been in development lately of a different nature to the existing content on the website. We use the privacy friendly open source website analytics platform <a rel=\"noreferrer noopener\" href=\"https:\/\/matomo.org\/\" data-type=\"URL\" data-id=\"https:\/\/matomo.org\/\" target=\"_blank\">Matomo<\/a> that is hosted on-premises where we fully own the data that allows us to understand the usage and interest in this service we provide.   <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This website analytics data have been used to determine whether there is a correlation between the visits are made to the website compared to amount of the rainfall at the time and to test whether visitor activity is stronger during wetter weather.  From this it have been discovered that at this time that while a lot of visits are made when there is no rainfall, when expressed in percentage terms that there is a general trend in more interest in the website during wetter weather, whilst visits across the range of rainfall totals are very consistent. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This information of visits by rainfall have been published on the new page as four charts using this information calculated from our databases. In addition to this, more standard summarised data over time of the number of visits, the type of devices used and the visits made by returning and frequently returning visitors. On that page are explanations of the definitions relating to this data and also there are key metric for various periods to provide a quick summary.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you to all those who have shown an interest in this website and the many who have come back to this website many times. I have been quite surprised at the strong visitor activity that has occurred and there is clearly an interest on local real-time weather data. This website is in continued development with completed new works announced on this blog in addition to updates to the website that are mentioned on our <a rel=\"noreferrer noopener\" href=\"\/..\/..\/info.php\" data-type=\"URL\" data-id=\"\/..\/..\/info.php\" target=\"_blank\">Website Info<\/a> page. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The below information  is provided to share how this page is put together at this time for anyone who want to have more understanding of this. Both the analytics data and weather data are stored in MySQL databases, which are both used to create four database tables containing the data for the four graphs for the visits by rainfall. These calculations use table joins and appropriate aggregations to produce the data to allow for a fair comparison. But because these are quite complex calculations the database queries are not executed when a graph is viewed as retrieving the current data will add significant time to load the graph.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So given that this data doesn&#8217;t change too quickly, a SQL procedure is executed once a month to update the data for when someone visits the page. The SQL code used in that procedure is similar to the below example.  The methodology used is that a table is created to calculate the amount of rainfall in the previous 24 hours for each hour during the past year, of which this data is not readily available in the database. This is derived by first calculating the rain for each hour, then the cumulative rainfall during the last year for each hour and then calculate the amount of rainfall for each hour compared to the same time in the previous day.    <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once we have that data then table joins are used to merge the analytics data to this rainfall data for each of the four tables. Finally at the end the rainfall data is deleted, as the data is no longer needed.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \" title=\"SQL Procedure to create database tables of visits by rainfall\">DELIMITER $$\nCREATE DEFINER=`root`@`localhost` PROCEDURE `CreateTbls_recent_rainfall_by_visits`()\n\nBEGIN \nDECLARE exit handler for SQLEXCEPTION BEGIN GET DIAGNOSTICS CONDITION 1 @sqlstate = RETURNED_SQLSTATE,\n@errno = MYSQL_ERRNO,\n@text = MESSAGE_TEXT;\nSET\n  @full_error = CONCAT(\"ERROR \", @errno, \" (\", @sqlstate, \"): \", @text);\nSELECT\n  @full_error;\nEND;\n\/* create table of rainfall in past 24 hours for each hour for past year - used for each of the following 4 create tables *\/\nDROP TABLE IF EXISTS last_24_hrs_rain_past_year;\nCREATE TABLE last_24_hrs_rain_past_year (\n  updated_time DATETIME NOT NULL,\n  to_date DATETIME NOT NULL,\n  from_date DATETIME NOT NULL,\n  rain_in_last_24_hours FLOAT(5, 1) NULL,\n  cumulative_rain FLOAT(5, 1) NULL,\n  PRIMARY KEY (to_date)\n)\nSELECT\n  DATE_ADD(UTC_TIMESTAMP(), INTERVAL 10 HOUR) AS updated_time,\n  ROUND(HourlyCumulativeRain_a.cumulative_rain, 1) AS cumulative_rain,\n  HourlyCumulativeRain_a.date_hour AS to_date,\n  HourlyCumulativeRain_b.date_hour AS from_date,\n  ROUND(\n    (\n      HourlyCumulativeRain_a.cumulative_rain - HourlyCumulativeRain_b.cumulative_rain\n    ),\n    1\n  ) AS rain_in_last_24_hours\nFROM\n  (\n   \/* Query to return the cumulative rainfall for each hour for the past year plus 1 day and for the TO_DATE field of the outer query *\/\n    SELECT\n      hour AS date_hour,\n      ROUND((@CumlativeRain: = @CumlativeRain + rain_hour), 1) as cumulative_rain\n    FROM\n      (\n        SELECT\n          hour,\n          SUM(rain_since_midnight_hour) as rain_hour\n        FROM\n          (\n            SELECT\n              LogDateTime AS hour,\n              IF(\n                RainSinceMidnight &gt; 0,\n                RainSinceMidnight - @lastValue,\n                0\n              ) AS rain_since_midnight_hour,\n              @lastValue: = RainSinceMidnight,\n              @CumlativeRain: = 0\n            FROM\n              weatherdata.Monthly m,\n              (\n                SELECT\n                  @lastValue: = 0\n              ) SQLVars\n            WHERE\n              LogDateTime &gt;= (CURDATE() - INTERVAL 1 YEAR - INTERVAL 1 DAY)\n            GROUP BY\n              YEAR(m.LogDateTime),\n              MONTH(m.LogDateTime),\n              DAY(m.LogDateTime),\n              HOUR(m.LogDateTime),\n              MINUTE(m.LogDateTime)\n            ORDER BY\n              (LogDateTime)\n          ) as m1\n        GROUP BY\n          YEAR(hour),\n          MONTH(hour),\n          DAY(hour),\n          HOUR(hour)\n      ) as m2\n    GROUP BY\n      hour\n    ORDER BY\n      hour\n  ) AS HourlyCumulativeRain_a\n  LEFT JOIN (\n   \/* Query to return the cumulative rainfall for each hour for the past year plus 1 day for the FROM_DATE field of the outer query *\/\n    SELECT\n      hour AS date_hour,\n      ROUND((@CumlativeRain: = @CumlativeRain + rain_hour), 1) as cumulative_rain\n    FROM\n      (\n        SELECT\n          hour,\n          SUM(rain_since_midnight_hour) as rain_hour\n        FROM\n          (\n            SELECT\n              LogDateTime AS hour,\n              IF(\n                RainSinceMidnight &gt; 0,\n                RainSinceMidnight - @lastValue,\n                0\n              ) AS rain_since_midnight_hour,\n              @lastValue: = RainSinceMidnight,\n              @CumlativeRain: = 0\n            FROM\n              weatherdata.Monthly m,\n              (\n                SELECT\n                  @lastValue: = 0\n              ) SQLVars\n            WHERE\n              LogDateTime &gt;= (CURDATE() - INTERVAL 1 YEAR - INTERVAL 1 DAY)\n            GROUP BY\n              YEAR(m.LogDateTime),\n              MONTH(m.LogDateTime),\n              DAY(m.LogDateTime),\n              HOUR(m.LogDateTime),\n              MINUTE(m.LogDateTime)\n            ORDER BY\n              (LogDateTime)\n          ) as m1\n        GROUP BY\n          YEAR(hour),\n          MONTH(hour),\n          DAY(hour),\n          HOUR(hour)\n      ) as m2\n    GROUP BY\n      hour\n    ORDER BY\n      hour\n  ) AS HourlyCumulativeRain_b ON \/* Join the inner queries to find the rainfall in the previous 24 hours for each hour *\/\n  HourlyCumulativeRain_a.date_hour - INTERVAL 1 DAY = HourlyCumulativeRain_b.date_hour\nWHERE\n  HourlyCumulativeRain_b.cumulative_rain IS NOT NULL;\n\/* end of create table *\/\n\n  -- query1 to create table -average daily rain by number of visitors\n  DROP TABLE IF EXISTS avg_daily_rain_by_visits;\nCREATE TABLE avg_daily_rain_by_visits (\n    updated_time DATETIME NOT NULL,\n    visit_time_count SMALLINT NOT NULL,\n    visit_total SMALLINT NOT NULL,\n    rain_in_last_24_hours SMALLINT NULL,\n    PRIMARY KEY (rain_in_last_24_hours)\n  )\nSELECT\n  updated_time,\n  COUNT(visit_time_hour) AS visit_time_count,\n  SUM(visit_count) AS visit_total,\n  rain_in_last_24_hours\nFROM\n  (\n    SELECT\n      last_24_hrs_rain_past_year.updated_time,\n      DATE_ADD(\n        DATE_FORMAT(\n          matomo.mtys_log_link_visit_action.server_time,\n          \"%Y-%m-%d %H\"\n        ),\n        INTERVAL 10 HOUR\n      ) AS visit_time_hour,\n      COUNT(\n        DISTINCT(matomo.mtys_log_link_visit_action.idvisitor)\n      ) AS visit_count,\n      ROUND(\n        AVG(last_24_hrs_rain_past_year.rain_in_last_24_hours),\n        0\n      ) AS rain_in_last_24_hours\n    FROM\n      matomo.mtys_log_link_visit_action\n      JOIN weatherdata.last_24_hrs_rain_past_year ON YEAR(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = YEAR(last_24_hrs_rain_past_year.to_date)\n      AND MONTH(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = MONTH(last_24_hrs_rain_past_year.to_date)\n      AND DAY(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = DAY(last_24_hrs_rain_past_year.to_date)\n      AND HOUR(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = HOUR(last_24_hrs_rain_past_year.to_date)\n    WHERE\n      matomo.mtys_log_link_visit_action.server_time &gt;= (\n        weatherdata.last_24_hrs_rain_past_year.updated_time - INTERVAL 1 YEAR\n      )\n      AND last_24_hrs_rain_past_year.rain_in_last_24_hours &lt;&gt; 0\n    GROUP BY\n      YEAR(matomo.mtys_log_link_visit_action.server_time),\n      MONTH(matomo.mtys_log_link_visit_action.server_time),\n      DAY(matomo.mtys_log_link_visit_action.server_time)\n  ) AS Data\nGROUP BY\n  rain_in_last_24_hours;\n\n\/* query2 to create table - average hourly rain by number of visitors *\/\n  DROP TABLE IF EXISTS avg_hourly_rain_by_visits;\nCREATE TABLE avg_hourly_rain_by_visits (\n    updated_time DATETIME NOT NULL,\n    visit_time_count SMALLINT NOT NULL,\n    visit_total SMALLINT NOT NULL,\n    rain_in_last_24_hours SMALLINT NULL,\n    PRIMARY KEY (rain_in_last_24_hours)\n  )\nSELECT\n  updated_time,\n  COUNT(visit_time_hour) AS visit_time_count,\n  SUM(visit_count) AS visit_total,\n  rain_in_last_24_hours\nFROM\n  (\n    SELECT\n      last_24_hrs_rain_past_year.updated_time,\n      DATE_ADD(\n        DATE_FORMAT(\n          matomo.mtys_log_link_visit_action.server_time,\n          \"%Y-%m-%d %H\"\n        ),\n        INTERVAL 10 HOUR\n      ) AS visit_time_hour,\n      COUNT(\n        DISTINCT(matomo.mtys_log_link_visit_action.idvisitor)\n      ) AS visit_count,\n      ROUND(\n        AVG(last_24_hrs_rain_past_year.rain_in_last_24_hours),\n        0\n      ) AS rain_in_last_24_hours\n    FROM\n      matomo.mtys_log_link_visit_action\n      JOIN weatherdata.last_24_hrs_rain_past_year ON YEAR(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = YEAR(last_24_hrs_rain_past_year.to_date)\n      AND MONTH(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = MONTH(last_24_hrs_rain_past_year.to_date)\n      AND DAY(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = DAY(last_24_hrs_rain_past_year.to_date)\n      AND HOUR(\n        DATE_ADD(\n          matomo.mtys_log_link_visit_action.server_time,\n          INTERVAL 10 HOUR\n        )\n      ) = HOUR(last_24_hrs_rain_past_year.to_date)\n    WHERE\n      matomo.mtys_log_link_visit_action.server_time &gt;= (\n        weatherdata.last_24_hrs_rain_past_year.updated_time - INTERVAL 1 YEAR\n      )\n      AND last_24_hrs_rain_past_year.rain_in_last_24_hours &lt;&gt; 0\n    GROUP BY\n      YEAR(matomo.mtys_log_link_visit_action.server_time),\n      MONTH(matomo.mtys_log_link_visit_action.server_time),\n      DAY(matomo.mtys_log_link_visit_action.server_time),\n      HOUR(matomo.mtys_log_link_visit_action.server_time)\n  ) AS Data\nGROUP BY\n  rain_in_last_24_hours;\n\n\/* query3 to create table - grouped hourly rainfall by visitors *\/\n  DROP TABLE IF EXISTS grouped_hourly_rain_by_visits;\nCREATE TABLE grouped_hourly_rain_by_visits (\n    updated_time DATETIME NOT NULL,\n    rain_in_last_24_hours_grouped VARCHAR(10),\n    visit_time_count SMALLINT NOT NULL,\n    visitor_total SMALLINT NOT NULL,\n    visitor_percent FLOAT(5, 4) NULL,\n    PRIMARY KEY (rain_in_last_24_hours_grouped)\n  )\nSELECT\n  updated_time,\n  rain_in_last_24_hours_grouped,\n  visit_time_count,\n  visitor_total,\n  visitor_total \/ total_visitors.visitor_grand_total AS visitor_percent\nFROM\n  \/* take the visitor and recent rainfall values and bin into the standard rainfall groups *\/\n  (\n    SELECT\n      updated_time,\n      COUNT(visit_time_hour) AS visit_time_count,\n      SUM(visitor_count) AS visitor_total,\n      CASE\n        WHEN rain_in_last_24_hours = 0 THEN 0\n        WHEN rain_in_last_24_hours = 0.2 THEN 0.2\n        WHEN rain_in_last_24_hours BETWEEN 0.2\n        AND 1 THEN '0.4 to &lt;1'\n        WHEN rain_in_last_24_hours BETWEEN 1\n        AND 5 THEN '1 to &lt;5'\n        WHEN rain_in_last_24_hours BETWEEN 5\n        AND 10 THEN '5 to &lt;10'\n        WHEN rain_in_last_24_hours BETWEEN 10\n        AND 20 THEN '10 to &lt;20'\n        WHEN rain_in_last_24_hours BETWEEN 20\n        AND 50 THEN '20 to &lt;50'\n        WHEN rain_in_last_24_hours BETWEEN 50\n        AND 100 THEN '50 to &lt;100'\n        WHEN rain_in_last_24_hours &gt;= 100 THEN '&gt;=100'\n        ELSE ROUND(rain_in_last_24_hours, 0)\n      END AS rain_in_last_24_hours_grouped,\n      rain_in_last_24_hours\n    FROM\n      (\n        \/* Inner query to join visitor information to rainfall in the preceding 24 hours for the past year. *\/\n        SELECT\n          weatherdata.last_24_hrs_rain_past_year.updated_time AS updated_time,\n          DATE_ADD(\n            DATE_FORMAT(\n              matomo.mtys_log_link_visit_action.server_time,\n              \"%Y-%m-%d %H\"\n            ),\n            INTERVAL 10 HOUR\n          ) AS visit_time_hour,\n          COUNT(\n            DISTINCT(matomo.mtys_log_link_visit_action.idvisitor)\n          ) AS visitor_count,\n          last_24_hrs_rain_past_year.rain_in_last_24_hours\n        FROM\n          matomo.mtys_log_link_visit_action\n          LEFT JOIN weatherdata.last_24_hrs_rain_past_year ON YEAR(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = YEAR(last_24_hrs_rain_past_year.to_date)\n          AND MONTH(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = MONTH(last_24_hrs_rain_past_year.to_date)\n          AND DAY(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = DAY(last_24_hrs_rain_past_year.to_date)\n          AND HOUR(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = HOUR(last_24_hrs_rain_past_year.to_date)\n        WHERE\n          matomo.mtys_log_link_visit_action.server_time &gt;= (\n            weatherdata.last_24_hrs_rain_past_year.updated_time - INTERVAL 1 YEAR\n          )\n        GROUP BY\n          YEAR(matomo.mtys_log_link_visit_action.server_time),\n          MONTH(matomo.mtys_log_link_visit_action.server_time),\n          DAY(matomo.mtys_log_link_visit_action.server_time),\n          HOUR(matomo.mtys_log_link_visit_action.server_time)\n      ) AS Data1\n    GROUP BY\n      rain_in_last_24_hours_grouped\n  ) AS Data2 \/* Cross Join query to find the total number of visits. This is used in the outer SELECT to calculate the % distribution of visits by grouped rainfall amounts *\/\n  CROSS JOIN (\n    SELECT\n      SUM(visitor_count) AS visitor_grand_total\n    FROM\n      (\n        SELECT\n          COUNT(\n            DISTINCT(matomo.mtys_log_link_visit_action.idvisitor)\n          ) AS visitor_count\n        FROM\n          matomo.mtys_log_link_visit_action\n          LEFT JOIN weatherdata.last_24_hrs_rain_past_year ON YEAR(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = YEAR(last_24_hrs_rain_past_year.to_date)\n          AND MONTH(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = MONTH(last_24_hrs_rain_past_year.to_date)\n          AND DAY(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = DAY(last_24_hrs_rain_past_year.to_date)\n          AND HOUR(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = HOUR(last_24_hrs_rain_past_year.to_date)\n        WHERE\n          matomo.mtys_log_link_visit_action.server_time &gt;= (\n            weatherdata.last_24_hrs_rain_past_year.updated_time - INTERVAL 1 YEAR\n          )\n        GROUP BY\n          YEAR(matomo.mtys_log_link_visit_action.server_time),\n          MONTH(matomo.mtys_log_link_visit_action.server_time),\n          DAY(matomo.mtys_log_link_visit_action.server_time),\n          HOUR(matomo.mtys_log_link_visit_action.server_time)\n      ) AS Data\n  ) as total_visitors\nGROUP BY\n  rain_in_last_24_hours_grouped\nORDER BY\n  rain_in_last_24_hours;\n\n\/* query4 to create table - visitor engagement by grouped daily rainfall *\/\n  \/* Query to return the % visitors engagement by rainfall amount joining weatherdata to analytics data *\/\n  DROP TABLE IF EXISTS visit_activity_by_grouped_daily_rain;\nCREATE TABLE visit_activity_by_grouped_daily_rain (\n    updated_time DATETIME NOT NULL,\n    rain_in_last_24_hours_grouped VARCHAR(10) NOT NULL,\n    rain_in_last_24_hours_count SMALLINT NOT NULL,\n    visit_time_count SMALLINT NULL,\n    visitor_total SMALLINT NOT NULL,\n    visitor_percent_of_grouped_rain FLOAT(5, 4) NOT NULL,\n    PRIMARY KEY (rain_in_last_24_hours_grouped)\n  )\nSELECT\n  updated_time,\n  rain_in_last_24_hours_grouped,\n  rain_in_last_24_hours_count,\n  visit_time_count,\n  visitor_total,\n  ROUND(visit_time_count \/ rain_in_last_24_hours_count, 3) AS visitor_percent_of_grouped_rain\nFROM\n  \/* take the visitor and recent rainfall values and bin into the standard rainfall groups *\/\n  (\n    SELECT\n      updated_time,\n      COUNT(rain_time_hour) AS rain_in_last_24_hours_count,\n      COUNT(visit_time_hour) AS visit_time_count,\n      SUM(visitor_count) AS visitor_total,\n      IF(\n        rain_in_last_24_hours = 0,\n        0,\n        IF(\n          rain_in_last_24_hours = 0.2,\n          0.2,\n          IF(\n            rain_in_last_24_hours BETWEEN 0.2\n            AND 1,\n            '0.4 to &lt;1',\n            IF(\n              rain_in_last_24_hours BETWEEN 1\n              AND 5,\n              '1 to &lt;5',\n              IF(\n                rain_in_last_24_hours BETWEEN 5\n                AND 10,\n                '5 to &lt;10',\n                IF(\n                  rain_in_last_24_hours BETWEEN 10\n                  AND 20,\n                  '10 to &lt;20',\n                  IF(\n                    rain_in_last_24_hours BETWEEN 20\n                    AND 50,\n                    '20 to &lt;50',\n                    IF(\n                      rain_in_last_24_hours BETWEEN 50\n                      AND 100,\n                      '50 to &lt;100',\n                      IF(\n                        rain_in_last_24_hours BETWEEN 100\n                        AND 1000,\n                        '&gt;100',\n                        ROUND(rain_in_last_24_hours, 0)\n                      )\n                    )\n                  )\n                )\n              )\n            )\n          )\n        )\n      ) as rain_in_last_24_hours_grouped,\n      rain_in_last_24_hours\n    FROM\n      (\n        \/* Inner query to join visitor information to average rainfall grouped by day by rainfall in the preceding 24 hours for the past year *\/\n        SELECT\n          last_24_hrs_rain_past_year.updated_time AS updated_time,\n          DATE_ADD(\n            DATE_FORMAT(\n              last_24_hrs_rain_past_year.to_date,\n              \"%Y-%m-%d %H\"\n            ),\n            INTERVAL 10 HOUR\n          ) AS rain_time_hour,\n          DATE_ADD(\n            DATE_FORMAT(\n              matomo.mtys_log_link_visit_action.server_time,\n              \"%Y-%m-%d %H\"\n            ),\n            INTERVAL 10 HOUR\n          ) AS visit_time_hour,\n          CASE\n            WHEN COUNT(\n              DISTINCT(matomo.mtys_log_link_visit_action.idvisitor)\n            ) &gt;= 1 THEN COUNT(\n              DISTINCT(matomo.mtys_log_link_visit_action.idvisitor)\n            )\n            ELSE 0\n          END AS visitor_count,\n          AVG(\n            weatherdata.last_24_hrs_rain_past_year.rain_in_last_24_hours\n          ) AS rain_in_last_24_hours\n        FROM\n          matomo.mtys_log_link_visit_action\n          RIGHT JOIN weatherdata.last_24_hrs_rain_past_year ON YEAR(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = YEAR(last_24_hrs_rain_past_year.to_date)\n          AND MONTH(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = MONTH(last_24_hrs_rain_past_year.to_date)\n          AND DAY(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = DAY(last_24_hrs_rain_past_year.to_date)\n          AND HOUR(\n            DATE_ADD(\n              matomo.mtys_log_link_visit_action.server_time,\n              INTERVAL 10 HOUR\n            )\n          ) = HOUR(last_24_hrs_rain_past_year.to_date)\n        WHERE\n          last_24_hrs_rain_past_year.to_date &gt;= (CURDATE() - INTERVAL 1 YEAR)\n        GROUP BY\n          YEAR(last_24_hrs_rain_past_year.to_date),\n          MONTH(last_24_hrs_rain_past_year.to_date),\n          DAY(last_24_hrs_rain_past_year.to_date)\n      ) AS Data\n    GROUP BY\n      rain_in_last_24_hours_grouped\n  ) AS DATA\nGROUP BY\n  rain_in_last_24_hours_grouped\nORDER BY\n  rain_in_last_24_hours;\n\n\/* finally delete the rainfall table initially created as we don't need that data now *\/\n  DROP TABLE IF EXISTS last_24_hrs_rain_past_year;\nEND$$\nDELIMITER ;<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"> The other graphs that don&#8217;t compare the rainfall by visits use php scripts to run a query to retrieve the necessary information from the database and insert that data into arrays in a format that the Highcharts graphs can use. This is quite similar to the other graphs on the website. The Javascript code for the highcharts is heavily based on the graphs elsewhere on this website, which is accessible through viewing the page source code. From the Javascript code the code of the php scripts used as the data input can be accessed by appending a <code>?view=sce <\/code>to the url.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The summary statistics at the top of the page uses data from a php script that contains a series of variables whose values are assigned from the result of SQL queries. That <a rel=\"noreferrer noopener\" href=\"\/..\/..\/utils\/SQL-queries\/analyticsData.php?view=sce\" data-type=\"URL\" data-id=\"\/..\/..\/utils\/SQL-queries\/analyticsData.php?view=sce\" target=\"_blank\">php script<\/a> is used as an <em>php include<\/em> in the web page like this: <code>include '.\/utils\/SQL-queries\/analyticsData.php';<\/code> and the variables in that script are used within the table such as: <code>&lt;?php echo $visits7day ?&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Similarly a php script is used to return a variable for populating the update time for the visits by rainfall data. This is quite simple in that it returns the distinct <code>updated_time<\/code> field of the one of the database tables containing this data and the query is formatted in php to show the date in the required date format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These are the SQL statements to calculate the summary statistics in the table: <\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \" title=\"SQL for calculating visit summary statistics\">\/* construct a new query for visits and visitors in last 24 hrs *\/\n\tSELECT\n\t\t\t\t\tCOUNT(DISTINCT(idvisit)) AS visits,\n\t\t\t\t\tCOUNT(DISTINCT(idvisitor)) AS visitors\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action\n\t\t\t\tWHERE \n\t\t\t\t\tDATE_ADD(server_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 1 DAY );\n\t\n\/* construct a new query for visits in last 7 days *\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(DISTINCT(idvisit)) AS visits,\n\t\t\t\t\tCOUNT(DISTINCT(idvisitor)) AS visitors\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action\n\t\t\t\tWHERE \n\t\t\t\t\tDATE_ADD(server_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 7 DAY );\n\n\n\/*construct a new query for visits in last 30 days*\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(DISTINCT(idvisit)) AS visits,\n\t\t\t\t\tCOUNT(DISTINCT(idvisitor)) AS visitors\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action\n\t\t\t\tWHERE \n\t\t\t\t\tDATE_ADD(server_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 1 MONTH );\n\n\/*construct a new query for visits -all time*\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(DISTINCT(idvisit)) AS visits,\n\t\t\t\t\tCOUNT(DISTINCT(idvisitor)) AS visitors\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action;\n\n\/*construct a new query for page views in last 24 hrs*\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(idvisitor) AS page_views\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action\n\t\t\t\tWHERE \n\t\t\t\t\tDATE_ADD(server_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 1 DAY );\n\n\/* construct a new query for page views in last 7 days *\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(idvisitor) AS page_views\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action\n\t\t\t\tWHERE \n\t\t\t\t\tDATE_ADD(server_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 7 DAY );\n \n\n\/* construct a new query for page views in last 30 days*\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(idvisitor) AS page_views\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action\n\t\t\t\tWHERE \n\t\t\t\t\tDATE_ADD(server_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 1 MONTH );\n\n\/* construct a new query for page views -all time*\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(idvisitor) AS page_views\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_link_visit_action;\n\n\/* construct a new query for return visits in last 24 hrs*\/\n\t\t\t\tSELECT\n\t\t\t\t\tCOUNT(DISTINCT idvisit) AS return_visits\n\t\t\t\tFROM\n\t\t\t\t\tmtys_log_visit\n\t\t\t\tWHERE\n\t\t\t\t\tvisitor_returning &lt;&gt; 0 \n\t\t\t\t\tAND DATE_ADD(visit_last_action_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 1 DAY );\n\n\/* construct a new query for return visits in last 7 days *\/\n\t\t\tSELECT\n\t\t\t\tCOUNT(DISTINCT idvisit) AS return_visits\n\t\t\tFROM\n\t\t\t\tmtys_log_visit\n            WHERE\n            \tvisitor_returning &lt;&gt; 0 \n                AND DATE_ADD(visit_last_action_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 7 DAY );\n\n\/* construct a new query for return visits in last 30 days *\/\n\t\t\tSELECT\n\t\t\t\tCOUNT(DISTINCT idvisit) AS return_visits\n\t\t\tFROM\n\t\t\t\tmtys_log_visit\n            WHERE\n            \tvisitor_returning &lt;&gt; 0 \n                AND DATE_ADD(visit_last_action_time,INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 30 DAY );\n\n\/* construct a new query for return visits -all time*\/\n\t\t\tSELECT\n\t\t\t\tCOUNT(DISTINCT idvisit) AS return_visits\n\t\t\tFROM\n\t\t\t\tmtys_log_visit\n            WHERE\n            \tvisitor_returning &lt;&gt; 0;\n\n\n\/* construct a new query for frequent return visits in last 24 hrs*\/\n\t\t\t\/*To return the number of regular visitors and the number of visits*\/\n\t\t\tSELECT COUNT(visitors) AS visitors, SUM(count_visits) as visits\n\t\t\tFROM(\n\t\t\t\t-- inner query to get all regular visitors  \n\t\t\t\tSELECT\n\t\t\t\t\t\tidvisitor AS visitors,\n\t\t\t\t\t\tcount(idvisitor) as count_visits\n\t\t\t\tFROM\n\t\t\t\t\t\tmtys_log_visit\n\t\t\t\tWHERE\n\t\t\t\t\t\tvisitor_returning &gt; 0 \n\t\t\t\t\t\tAND DATE_ADD(visit_last_action_time, INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 1 DAY )\n\t\t\t\t\t\tAND visitor_days_since_last &lt;=30\n\t\t\t\tGROUP BY \n\t\t\t\t\t\tidvisitor\n\t\t\t\t) AS Data\n\t\t\t\t\/* subquery to return just the visitors that have contributed 2 visits *\/\n\t\t\tWHERE count_visits &gt;= 2;\n\n\/* construct a new query for frequent return visits in last 7 days*\/\n\t\t\t\/*-- To return the number of regular visitors and the number of visits*\/\n\t\t\tSELECT COUNT(visitors) AS visitors, SUM(count_visits) as visits\n\t\t\tFROM(\n\t\t\t\t-- inner query to get all regular visitors  \n\t\t\t\tSELECT\n\t\t\t\t\t\tidvisitor AS visitors,\n\t\t\t\t\t\tcount(idvisitor) as count_visits\n\t\t\t\tFROM\n\t\t\t\t\t\tmtys_log_visit\n\t\t\t\tWHERE\n\t\t\t\t\t\tvisitor_returning &gt; 0 \n\t\t\t\t\t\tAND DATE_ADD(visit_last_action_time, INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 7 DAY )\n\t\t\t\t\t\tAND visitor_days_since_last &lt;=30\n\t\t\t\tGROUP BY \n\t\t\t\t\t\tidvisitor\n\t\t\t\t) AS Data\n\t\t\t\t\/* subquery to return just the visitors that have contributed 4 visits*\/\n\t\t\tWHERE count_visits &gt;= 4;\n\t\n\/* construct a new query for frequent return visits in last 30 days*\/\n\t\t\t\/*To return the number of regular visitors and the number of visits*\/\n\t\t\tSELECT COUNT(visitors) AS visitors, SUM(count_visits) as visits\n\t\t\tFROM(\n\t\t\t\t\/* inner query to get all regular visitors  *\/\n\t\t\t\tSELECT\n\t\t\t\t\t\tidvisitor AS visitors,\n\t\t\t\t\t\tcount(idvisitor) as count_visits\n\t\t\t\tFROM\n\t\t\t\t\t\tmtys_log_visit\n\t\t\t\tWHERE\n\t\t\t\t\t\tvisitor_returning &gt; 0 \n\t\t\t\t\t\tAND DATE_ADD(visit_last_action_time, INTERVAL 10 HOUR) &gt;= (CURDATE() - INTERVAL 30 DAY )\n\t\t\t\t\t\tAND visitor_days_since_last &lt;=30\n\t\t\t\tGROUP BY \n\t\t\t\t\t\tidvisitor\n\t\t\t\t) AS Data\n\t\t\t\t\/* subquery to return just the visitors that have contributed to 5 visits*\/\n\t\t\tWHERE count_visits &gt;= 5;\n\n\t\n\t\n\/* construct a new query for frequent return visits - all time*\/\n\t\t\t\/* To return the number of regular visitors and the number of visits*\/\n\t\t\tSELECT COUNT(visitors) AS visitors, SUM(count_visits) as visits\n\t\t\tFROM(\n\t\t\t\t\/* inner query to get all regular visitors *\/ \n\t\t\t\tSELECT\n\t\t\t\t\t\tidvisitor AS visitors,\n\t\t\t\t\t\tcount(idvisitor) as count_visits\n\t\t\t\tFROM\n\t\t\t\t\t\tmtys_log_visit\n\t\t\t\tWHERE\n\t\t\t\t\t\tvisitor_returning &gt; 0\n\t\t\t\t\t\tAND visitor_days_since_last &lt;=30\n\t\t\t\tGROUP BY \n\t\t\t\t\t\tidvisitor\n\t\t\t\t) AS Data\n\t\t\t\t\/* subquery to return just the visitors that have contributed to 1 % of the total frequent return visitor numbers *\/\n\t\t\tWHERE count_visits &gt;= (SELECT \n\t\t\t\t\t\t\t\t\t\t0.01*COUNT(idvisitor) \n\t\t\t\t\t\t\t\t   FROM \n\t\t\t\t\t\t\t\t\t\tmtys_log_visit \n\t\t\t\t\t\t\t\t   WHERE\n\t\t\t\t\t\t\t\t\t\tvisitor_returning &gt; 0 \n\t\t\t\t\t\t\t\t\t\tAND visitor_days_since_last &lt;=30);\n<\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"> And these are the SQL statements to return the data for the graphs excluding the visits by rainfall which while a php script also retrieves that data, those queries are very basic because the data is already pre-generated.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \" title=\"SQL for plotted monthly website analytics data\">\/* construct a new query for visits by month*\/\n\t\t\tSELECT\n\t\t\t\tUNIX_TIMESTAMP(server_time),\n\t\t\t\tCOUNT(DISTINCT(idvisit)) AS visits,\n\t\t\t\tCOUNT(idvisitor) AS page_views,\n\t\t\t\tCOUNT(DISTINCT(idvisitor)) AS visitors\n\t\t\tFROM\n\t\t\t\tmtys_log_link_visit_action\n\t\t\tGROUP BY\n\t\t\t\tYEAR(server_time),\n\t\t\t\tMONTH(server_time);\n\t\n\/* construct a new query for monthly visits by device type *\/\n\t\t\tSELECT UNIX_TIMESTAMP(date_format(visit_time, \"%Y-%m-01\")) as visit_time, desktop_visit, mobile_visit, tablet_visit, mobile_percent\n\t\t\tFROM (\n\t\t\t\tSELECT  server_time as visit_time,     \n\t\t\t\t\t\tCOUNT(DISTINCT CASE WHEN config_device_type = 0 THEN mtys_log_link_visit_action.idvisit END) AS desktop_visit,         \n\t\t\t\t\t\tCOUNT(DISTINCT CASE WHEN config_device_type = 1 THEN mtys_log_link_visit_action.idvisit END) AS mobile_visit,         \n\t\t\t\t\t\tCOUNT(DISTINCT CASE WHEN config_device_type = 2 THEN mtys_log_link_visit_action.idvisit END) AS tablet_visit,                                       \n\t\t\t\t\t\tROUND(COUNT(DISTINCT CASE WHEN config_device_type = 1 THEN mtys_log_link_visit_action.idvisit END) \/ COUNT(DISTINCT mtys_log_link_visit_action.idvisit) *100,1) AS mobile_percent \n\n\t\t\t\tFROM mtys_log_visit INNER JOIN mtys_log_link_visit_action ON mtys_log_visit.idvisitor = mtys_log_link_visit_action.idvisitor \n\t\t\t\tGROUP BY YEAR(visit_time), MONTH(visit_time)\n\t\t\t\t) AS Data\n\t\t\tGROUP BY YEAR(visit_time), MONTH(visit_time);\n\n\n\/*construct a new query for monthly return and frequent return visits*\/\n\t\t\t\tSELECT \tUNIX_TIMESTAMP(date_format(visit_last_action_time, \"%Y-%m-01\")) AS visit_last_action_time,\n\t\t\t\tCOUNT(DISTINCT idvisitor) as visitors,\n\t\t\t\tSUM(visits) AS visits\n\t\t\t\tFROM(\n\t\t\t\t\tSELECT \t*\n\t\t\t\t\t\tFROM(\n\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\tDATE_ADD(visit_last_action_time, INTERVAL 10 HOUR) AS visit_last_action_time,\n\t\t\t\t\t\t\t\tidvisitor,\n\t\t\t\t\t\t\t\tCOUNT( idvisitor) AS visits\n\t\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\t\tmtys_log_visit\n\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\tvisitor_returning &gt; 0 \n\t\t\t\t\t\t\t\t\tAND visitor_days_since_last &lt;=30\n\t\t\t\t\t\t\tGROUP BY year(visit_last_action_time), month(visit_last_action_time), idvisitor\n\t\t\t\t\t\t\tORDER BY `visits`  DESC\n\t\t\t\t\t\t\t) AS Visits\n\t\t\t\t\tWHERE visits &gt;= 5\n\t\t\t\t)AS visits_summ\n\t\t\tGROUP BY year(visit_last_action_time), month(visit_last_action_time);<\/pre><\/div>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"132\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">0    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"132\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-down\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\">0<\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>A new page is now available that has been in development lately of a different nature to the existing content on the website. We use the privacy friendly open source website analytics platform Matomo that is hosted on-premises where we fully own the data that allows us to understand the usage and interest in this [&hellip;]<\/p>\n<div style='clear:both'><\/div><div  class='the_champ_sharing_container the_champ_horizontal_sharing' data-super-socializer-href=\"https:\/\/fernygroveweather.com\/blog\/2020\/11\/08\/website-analytics\/\"><div class='the_champ_sharing_title' style=\"font-weight:bold\" >Want to share this?<\/div><div class=\"the_champ_sharing_ul\"><a aria-label=\"Facebook\" class=\"the_champ_facebook\" href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Ffernygroveweather.com%2Fblog%2F2020%2F11%2F08%2Fwebsite-analytics%2F\" title=\"Facebook\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:24px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"the_champ_svg\" style=\"background-color:#0765FE;width:35px;height:35px;border-radius:999px;display:inline-block;opacity:1;float:left;font-size:24px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;border-radius:999px;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 32 32\"><path fill=\"#fff\" d=\"M28 16c0-6.627-5.373-12-12-12S4 9.373 4 16c0 5.628 3.875 10.35 9.101 11.647v-7.98h-2.474V16H13.1v-1.58c0-4.085 1.849-5.978 5.859-5.978.76 0 2.072.15 2.608.298v3.325c-.283-.03-.775-.045-1.386-.045-1.967 0-2.728.745-2.728 2.683V16h3.92l-.673 3.667h-3.247v8.245C23.395 27.195 28 22.135 28 16Z\"><\/path><\/svg><\/span><span class=\"the_champ_square_count the_champ_facebook_count\">&nbsp;<\/span><\/a><a aria-label=\"Twitter\" class=\"the_champ_button_twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?text=Website%20analytics&url=https%3A%2F%2Ffernygroveweather.com%2Fblog%2F2020%2F11%2F08%2Fwebsite-analytics%2F\" title=\"Twitter\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:24px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"the_champ_svg the_champ_s__default the_champ_s_twitter\" style=\"background-color:#55acee;width:35px;height:35px;border-radius:999px;display:inline-block;opacity:1;float:left;font-size:24px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;border-radius:999px;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"-4 -4 39 39\"><path d=\"M28 8.557a9.913 9.913 0 0 1-2.828.775 4.93 4.93 0 0 0 2.166-2.725 9.738 9.738 0 0 1-3.13 1.194 4.92 4.92 0 0 0-3.593-1.55 4.924 4.924 0 0 0-4.794 6.049c-4.09-.21-7.72-2.17-10.15-5.15a4.942 4.942 0 0 0-.665 2.477c0 1.71.87 3.214 2.19 4.1a4.968 4.968 0 0 1-2.23-.616v.06c0 2.39 1.7 4.38 3.952 4.83-.414.115-.85.174-1.297.174-.318 0-.626-.03-.928-.086a4.935 4.935 0 0 0 4.6 3.42 9.893 9.893 0 0 1-6.114 2.107c-.398 0-.79-.023-1.175-.068a13.953 13.953 0 0 0 7.55 2.213c9.056 0 14.01-7.507 14.01-14.013 0-.213-.005-.426-.015-.637.96-.695 1.795-1.56 2.455-2.55z\" fill=\"#fff\"><\/path><\/svg><\/span><span class=\"the_champ_square_count the_champ_twitter_count\">&nbsp;<\/span><\/a><a aria-label=\"Linkedin\" class=\"the_champ_button_linkedin\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Ffernygroveweather.com%2Fblog%2F2020%2F11%2F08%2Fwebsite-analytics%2F\" title=\"Linkedin\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:24px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"the_champ_svg the_champ_s__default the_champ_s_linkedin\" style=\"background-color:#0077b5;width:35px;height:35px;border-radius:999px;display:inline-block;opacity:1;float:left;font-size:24px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;border-radius:999px;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 32 32\"><path d=\"M6.227 12.61h4.19v13.48h-4.19V12.61zm2.095-6.7a2.43 2.43 0 0 1 0 4.86c-1.344 0-2.428-1.09-2.428-2.43s1.084-2.43 2.428-2.43m4.72 6.7h4.02v1.84h.058c.56-1.058 1.927-2.176 3.965-2.176 4.238 0 5.02 2.792 5.02 6.42v7.395h-4.183v-6.56c0-1.564-.03-3.574-2.178-3.574-2.18 0-2.514 1.7-2.514 3.46v6.668h-4.187V12.61z\" fill=\"#fff\"><\/path><\/svg><\/span><span class=\"the_champ_square_count the_champ_linkedin_count\">&nbsp;<\/span><\/a><a aria-label=\"Email\" class=\"the_champ_email\" href=\"https:\/\/fernygroveweather.com\/blog\/2020\/11\/08\/website-analytics\/\" onclick=\"event.preventDefault();window.open('mailto:?subject=' + decodeURIComponent('Website%20analytics').replace('&', '%26') + '&body=' + decodeURIComponent('https%3A%2F%2Ffernygroveweather.com%2Fblog%2F2020%2F11%2F08%2Fwebsite-analytics%2F'), '_blank')\" title=\"Email\" rel=\"noopener\" style=\"font-size:24px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"the_champ_svg\" style=\"background-color:#649a3f;width:35px;height:35px;border-radius:999px;display:inline-block;opacity:1;float:left;font-size:24px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;border-radius:999px;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"-.5 -.5 36 36\"><path d=\"M 5.5 11 h 23 v 1 l -11 6 l -11 -6 v -1 m 0 2 l 11 6 l 11 -6 v 11 h -22 v -11\" stroke-width=\"1\" fill=\"#fff\"><\/path><\/svg><\/span><span class=\"the_champ_square_count the_champ_email_count\">&nbsp;<\/span><\/a><a aria-label=\"Outlook.com\" class=\"the_champ_button_outlook_com\" href=\"https:\/\/mail.live.com\/default.aspx?rru=compose?subject=Website%20analytics&body=https%3A%2F%2Ffernygroveweather.com%2Fblog%2F2020%2F11%2F08%2Fwebsite-analytics%2F&lc=1033&id=64855&mkt=en-us&cbcxt=mai\" title=\"Outlook.com\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:24px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"the_champ_svg the_champ_s__default the_champ_s_outlook_com\" style=\"background-color:#0072c6;width:35px;height:35px;border-radius:999px;display:inline-block;opacity:1;float:left;font-size:24px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;border-radius:999px;\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"-4 -3.5 40 40\" width=\"100%\" height=\"100%\"><path fill=\"#fff\" d=\"M19.52 8.29v5.5l1.92 1.208c.053.016.163.016.212 0l8.27-5.574c0-.66-.613-1.134-.962-1.134h-9.44z\"\/><path fill=\"#fff\" d=\"M19.52 15.84l1.755 1.204c.246.183.543 0 .543 0-.297.183 8.104-5.397 8.104-5.397V21.75c0 1.102-.704 1.562-1.496 1.562H19.52V15.84z\"\/><g fill=\"#fff\"><path d=\"M10.445 13.305c-.6 0-1.073.282-1.426.842-.355.56-.53 1.305-.53 2.23 0 .936.175 1.677.53 2.22.347.546.813.82 1.38.82.59 0 1.055-.266 1.4-.795.344-.53.517-1.266.517-2.206 0-.984-.17-1.744-.502-2.288-.333-.55-.79-.823-1.37-.823z\"\/><path d=\"M2.123 5.5v21.51l16.362 3.428V2.33L2.123 5.5zm10.95 14.387c-.693.91-1.594 1.367-2.706 1.367-1.082 0-1.967-.442-2.65-1.324-.68-.88-1.02-2.03-1.02-3.448 0-1.496.343-2.707 1.037-3.63.693-.926 1.614-1.388 2.754-1.388 1.08 0 1.955.438 2.62 1.324.667.885 1 2.05 1 3.495.004 1.496-.345 2.695-1.034 3.604z\"\/><\/g><\/svg><\/span><span class=\"the_champ_square_count the_champ_Outlook.com_count\">&nbsp;<\/span><\/a><a aria-label=\"Gmail\" class=\"the_champ_button_google_gmail\" href=\"https:\/\/mail.google.com\/mail\/?ui=2&view=cm&fs=1&tf=1&su=Website%20analytics&body=Link:https%3A%2F%2Ffernygroveweather.com%2Fblog%2F2020%2F11%2F08%2Fwebsite-analytics%2F\" title=\"Google Gmail\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:24px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"the_champ_svg the_champ_s__default the_champ_s_Google_Gmail\" style=\"background-color:#e5e5e5;width:35px;height:35px;border-radius:999px;display:inline-block;opacity:1;float:left;font-size:24px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;border-radius:999px;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 32 32\"><path fill=\"#fff\" d=\"M2.902 6.223h26.195v19.554H2.902z\"><\/path><path fill=\"#E14C41\" class=\"the_champ_no_fill\" d=\"M2.902 25.777h26.195V6.223H2.902v19.554zm22.44-4.007v3.806H6.955v-3.6h.032l.093-.034 6.9-5.558 2.09 1.77 1.854-1.63 7.42 5.246zm0-.672l-7.027-4.917 7.028-6.09V21.1zm-1.17-14.67l-.947.905c-2.356 2.284-4.693 4.75-7.17 6.876l-.078.06L8.062 6.39l16.11.033zm-10.597 9.61l-6.62 5.294.016-10.914 6.607 5.62\"><\/path><\/svg><\/span><span class=\"the_champ_square_count the_champ_Google_Gmail_count\">&nbsp;<\/span><\/a><a aria-label=\"Copy Link\" class=\"the_champ_button_copy_link\" title=\"Copy Link\" rel=\"noopener\" href=\"https:\/\/fernygroveweather.com\/blog\/2020\/11\/08\/website-analytics\/\" onclick=\"event.preventDefault()\" style=\"font-size:24px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"the_champ_svg the_champ_s__default the_champ_s_copy_link\" style=\"background-color:#ffc112;width:35px;height:35px;border-radius:999px;display:inline-block;opacity:1;float:left;font-size:24px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;border-radius:999px;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"-4 -4 40 40\"><path fill=\"#fff\" d=\"M24.412 21.177c0-.36-.126-.665-.377-.917l-2.804-2.804a1.235 1.235 0 0 0-.913-.378c-.377 0-.7.144-.97.43.026.028.11.11.255.25.144.14.24.236.29.29s.117.14.2.256c.087.117.146.232.177.344.03.112.046.236.046.37 0 .36-.126.666-.377.918a1.25 1.25 0 0 1-.918.377 1.4 1.4 0 0 1-.373-.047 1.062 1.062 0 0 1-.345-.175 2.268 2.268 0 0 1-.256-.2 6.815 6.815 0 0 1-.29-.29c-.14-.142-.223-.23-.25-.254-.297.28-.445.607-.445.984 0 .36.126.664.377.916l2.778 2.79c.243.243.548.364.917.364.36 0 .665-.118.917-.35l1.982-1.97c.252-.25.378-.55.378-.9zm-9.477-9.504c0-.36-.126-.665-.377-.917l-2.777-2.79a1.235 1.235 0 0 0-.913-.378c-.35 0-.656.12-.917.364L7.967 9.92c-.254.252-.38.553-.38.903 0 .36.126.665.38.917l2.802 2.804c.242.243.547.364.916.364.377 0 .7-.14.97-.418-.026-.027-.11-.11-.255-.25s-.24-.235-.29-.29a2.675 2.675 0 0 1-.2-.255 1.052 1.052 0 0 1-.176-.344 1.396 1.396 0 0 1-.047-.37c0-.36.126-.662.377-.914.252-.252.557-.377.917-.377.136 0 .26.015.37.046.114.03.23.09.346.175.117.085.202.153.256.2.054.05.15.148.29.29.14.146.222.23.25.258.294-.278.442-.606.442-.983zM27 21.177c0 1.078-.382 1.99-1.146 2.736l-1.982 1.968c-.745.75-1.658 1.12-2.736 1.12-1.087 0-2.004-.38-2.75-1.143l-2.777-2.79c-.75-.747-1.12-1.66-1.12-2.737 0-1.106.392-2.046 1.183-2.818l-1.186-1.185c-.774.79-1.708 1.186-2.805 1.186-1.078 0-1.995-.376-2.75-1.13l-2.803-2.81C5.377 12.82 5 11.903 5 10.826c0-1.08.382-1.993 1.146-2.738L8.128 6.12C8.873 5.372 9.785 5 10.864 5c1.087 0 2.004.382 2.75 1.146l2.777 2.79c.75.747 1.12 1.66 1.12 2.737 0 1.105-.392 2.045-1.183 2.817l1.186 1.186c.774-.79 1.708-1.186 2.805-1.186 1.078 0 1.995.377 2.75 1.132l2.804 2.804c.754.755 1.13 1.672 1.13 2.75z\"\/><\/svg><\/span><span class=\"the_champ_square_count the_champ_Copy_Link_count\">&nbsp;<\/span><\/a><a class=\"the_champ_more\" title=\"More\" rel=\"nofollow noopener\" style=\"font-size:24px!important;border:0;box-shadow:none;display:inline-block!important;font-size:16px;padding:0 4px;vertical-align: middle;display:inline;\" href=\"https:\/\/fernygroveweather.com\/blog\/2020\/11\/08\/website-analytics\/\" onclick=\"event.preventDefault()\"><span class=\"the_champ_square_count\">&nbsp;<\/span><span class=\"the_champ_svg\" style=\"background-color:#ee8e2d;width:35px;height:35px;border-radius:999px;display:inline-block!important;opacity:1;float:left;font-size:32px!important;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;display:inline;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box;\" onclick=\"theChampMoreSharingPopup(this, 'https:\/\/fernygroveweather.com\/blog\/2020\/11\/08\/website-analytics\/', 'Website%20analytics', '' )\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\" viewBox=\"-.3 0 32 32\" version=\"1.1\" width=\"100%\" height=\"100%\" style=\"display:block;border-radius:999px;\" xml:space=\"preserve\"><g><path fill=\"#fff\" d=\"M18 14V8h-4v6H8v4h6v6h4v-6h6v-4h-6z\" fill-rule=\"evenodd\"><\/path><\/g><\/svg><\/span><\/a><a style=\"font-size:24px!important;box-shadow:none;display:inline-block!important;font-size: 16px;padding: 0 4px;vertical-align:middle;display:inline;\" class=\"theChampSharingRound\"><span class=\"the_champ_square_count\">&nbsp;<\/span><div style=\"width:35px;height:35px;border-radius:999px;margin-left:9px !important;\" title=\"Total Shares\" class=\"theChampSharing theChampTCBackground\"><\/div><\/a><\/div><\/div><div style='clear:both'><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5],"tags":[],"class_list":["post-132","post","type-post","status-publish","format-standard","hentry","category-announcements","category-web-development"],"_links":{"self":[{"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/posts\/132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/comments?post=132"}],"version-history":[{"count":45,"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions"}],"predecessor-version":[{"id":200,"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/posts\/132\/revisions\/200"}],"wp:attachment":[{"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/media?parent=132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/categories?post=132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fernygroveweather.com\/blog\/wp-json\/wp\/v2\/tags?post=132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}