From 2ff33488fe1dee66bd6c97e4de7d25fb113d9b39 Mon Sep 17 00:00:00 2001 From: Johan Girod Date: Thu, 27 Aug 2020 11:16:08 +0200 Subject: [PATCH] =?UTF-8?q?:bug:=20r=C3=A9pare=20la=20page=20stats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mon-entreprise/scripts/fetch-stats.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mon-entreprise/scripts/fetch-stats.js b/mon-entreprise/scripts/fetch-stats.js index 95995b16b..79fc305ce 100644 --- a/mon-entreprise/scripts/fetch-stats.js +++ b/mon-entreprise/scripts/fetch-stats.js @@ -6,7 +6,6 @@ // // Matomo API documentation: // https://developer.matomo.org/api-reference/reporting-api - require('dotenv').config() require('isomorphic-fetch') const querystring = require('querystring') @@ -321,7 +320,7 @@ async function fetchChannelType() { const response = await fetch( apiURL({ period: 'month', - date: 'last3', + date: 'last6', method: 'Referrers.getReferrerType' }) ) @@ -346,7 +345,9 @@ async function fetchChannelType() { return { currentMonth: { date: dates[0], visites: result[dates[0]] }, oneMonthAgo: { date: dates[1], visites: result[dates[1]] }, - twoMonthAgo: { date: dates[2], visites: result[dates[2]] } + twoMonthAgo: { date: dates[2], visites: result[dates[2]] }, + threeMonthAgo: { date: dates[3], visites: result[dates[3]] }, + fourMonthAgo: { date: dates[4], visites: result[dates[4]] } } } catch (e) { console.log('fail to fetch channel type')