Google Analytics - Version 4.0.0

Version Description

  • 15-Nov-2022
  • Update : Google Analytics v4 (GA4) support.
Download this release

Release Info

Developer amribrahim
Plugin Icon 128x128 Google Analytics
Version 4.0.0
Comparing to
See all releases

Code changes from version 3.3.4 to 4.0.0

core/GoogleAnalyticsAPI.class.php CHANGED
@@ -17,9 +17,9 @@ class GoogleAnalyticsAPI{
17
  const AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
18
  const REDIRECT_URI = lrgawidget_plugin_redirect_uri;
19
  const SCOPE_URL = 'https://www.googleapis.com/auth/analytics.readonly';
20
- const ACCOUNTS_SUMMARY_URL = "https://www.googleapis.com/analytics/v3/management/accountSummaries";
21
- const PROFILES_SUMMARY_URL = "https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles";
22
- const API_URL = 'https://www.googleapis.com/analytics/v3/data/ga';
23
 
24
 
25
  private $client_id;
@@ -27,7 +27,7 @@ class GoogleAnalyticsAPI{
27
  private $access_token;
28
  private $refresh_token;
29
  private $code;
30
- private $profile_id;
31
  private $start_date;
32
  private $end_date;
33
  private $dateRange = array();
@@ -59,18 +59,22 @@ class GoogleAnalyticsAPI{
59
  public function getAccounts() {
60
  return $this->httpRequest(self::ACCOUNTS_SUMMARY_URL, array('access_token' => $this->access_token), "GET");
61
  }
62
-
63
- public function getProfiles($params=array()) {
64
- return $this->httpRequest(self::PROFILES_SUMMARY_URL, array_merge(array('access_token' => $this->access_token), $params), "GET");
 
 
 
 
65
  }
 
66
  public function buildQuery($params=array()){
67
- $this->dateRange = array('start-date' => $this->start_date, 'end-date' => $this->end_date);
68
- $_params = array_merge($this->dateRange, array('access_token' => $this->access_token, 'ids' => "ga:".$this->profile_id));
69
- $this->queryParams = array_merge($_params, $params);
70
  }
71
 
72
  public function doQuery(){
73
- return $this->httpRequest(self::API_URL, $this->queryParams, "GET");
74
  }
75
 
76
  public function getAccessToken() {
@@ -98,9 +102,9 @@ class GoogleAnalyticsAPI{
98
  }else{ ErrorHandler::FatalError(__('Invalid Reply', 'lara-google-analytics'),__('Google Replied with unexpected replay, enable debugging to check the reply', 'lara-google-analytics'),101,$results); }
99
  }
100
 
101
- private function httpRequest ($url, $query, $method){
102
  if (defined("_CURRENT_QUOTAUSER_")){ $query["quotaUser"] = _CURRENT_QUOTAUSER_;}
103
- $doCall = $this->httpRequest->doQuickCall($url, $query, $method);
104
  $response = json_decode($doCall['Response'], true);
105
  if ($doCall['HTTP_Status_Code'] === 200){
106
  return $response;
@@ -123,7 +127,7 @@ class GoogleAnalyticsAPI{
123
  case 'access_token';
124
  case 'refresh_token';
125
  case 'code';
126
- case 'profile_id';
127
  case 'start_date';
128
  case 'end_date';
129
  $this->$property = $value;
17
  const AUTH_URL = 'https://accounts.google.com/o/oauth2/auth';
18
  const REDIRECT_URI = lrgawidget_plugin_redirect_uri;
19
  const SCOPE_URL = 'https://www.googleapis.com/auth/analytics.readonly';
20
+ const ACCOUNTS_SUMMARY_URL = "https://analyticsadmin.googleapis.com/v1beta/accountSummaries";
21
+ const PROPERTIES_SUMMARY_URL = "https://analyticsadmin.googleapis.com/v1beta/properties";
22
+ const API_URL = "https://analyticsdata.googleapis.com/v1beta/properties";
23
 
24
 
25
  private $client_id;
27
  private $access_token;
28
  private $refresh_token;
29
  private $code;
30
+ private $property_id;
31
  private $start_date;
32
  private $end_date;
33
  private $dateRange = array();
59
  public function getAccounts() {
60
  return $this->httpRequest(self::ACCOUNTS_SUMMARY_URL, array('access_token' => $this->access_token), "GET");
61
  }
62
+
63
+ public function getProperty($property_id) {
64
+ return $this->httpRequest(self::PROPERTIES_SUMMARY_URL . "/" . $property_id , array('access_token' => $this->access_token), "GET");
65
+ }
66
+
67
+ public function getDataStreams($property_id) {
68
+ return $this->httpRequest(self::PROPERTIES_SUMMARY_URL . "/" . $property_id . "/dataStreams" , array('access_token' => $this->access_token), "GET");
69
  }
70
+
71
  public function buildQuery($params=array()){
72
+ $this->dateRange = array("dateRanges" => array('startDate' => $this->start_date, 'endDate' => $this->end_date));
73
+ $this->queryParams = array_merge($this->dateRange, $params);
 
74
  }
75
 
76
  public function doQuery(){
77
+ return $this->httpRequest(self::API_URL . "/" . $this->property_id . ":runReport" , $this->queryParams, "JSON_POST", array("Authorization: Bearer " . $this->access_token));
78
  }
79
 
80
  public function getAccessToken() {
102
  }else{ ErrorHandler::FatalError(__('Invalid Reply', 'lara-google-analytics'),__('Google Replied with unexpected replay, enable debugging to check the reply', 'lara-google-analytics'),101,$results); }
103
  }
104
 
105
+ private function httpRequest ($url, $query, $method, $headers = array()){
106
  if (defined("_CURRENT_QUOTAUSER_")){ $query["quotaUser"] = _CURRENT_QUOTAUSER_;}
107
+ $doCall = $this->httpRequest->doQuickCall($url, $query, $method, $headers);
108
  $response = json_decode($doCall['Response'], true);
109
  if ($doCall['HTTP_Status_Code'] === 200){
110
  return $response;
127
  case 'access_token';
128
  case 'refresh_token';
129
  case 'code';
130
+ case 'property_id';
131
  case 'start_date';
132
  case 'end_date';
133
  $this->$property = $value;
core/callURL.class.php CHANGED
@@ -20,6 +20,7 @@ class CallURL{
20
  private $timeout;
21
  private $lastResult;
22
  private $jsonPost;
 
23
 
24
  function __construct(){
25
  $this->setDefaults();
@@ -71,7 +72,7 @@ class CallURL{
71
  $this->callOptions[CURLOPT_URL] = $this->url;
72
  $this->callOptions[CURLOPT_POST] = true;
73
  if ($this->jsonPost === true){
74
- $this->callOptions[CURLOPT_HTTPHEADER] = array("Content-Type: application/json; charset=UTF-8");
75
  $this->callOptions[CURLOPT_POSTFIELDS] = json_encode($this->query, true);
76
  }else{
77
  $this->callOptions[CURLOPT_POSTFIELDS] = http_build_query($this->query, '', '&');
@@ -83,6 +84,10 @@ class CallURL{
83
  }
84
  $this->callOptions[CURLOPT_URL] = $this->url.$query;
85
  }
 
 
 
 
86
 
87
  ## Check for cURL
88
  if (!extension_loaded('curl')) {
@@ -112,11 +117,12 @@ class CallURL{
112
  return $this->lastResult;
113
  }
114
 
115
- public function doQuickCall($url, $query=array(), $method="GET"){
116
  $this->setDefaults();
117
  $this->setMethod($method);
118
  $this->setURL($url);
119
  $this->setQuery($query);
 
120
  return $this->doCall();
121
  }
122
 
20
  private $timeout;
21
  private $lastResult;
22
  private $jsonPost;
23
+ private $headers;
24
 
25
  function __construct(){
26
  $this->setDefaults();
72
  $this->callOptions[CURLOPT_URL] = $this->url;
73
  $this->callOptions[CURLOPT_POST] = true;
74
  if ($this->jsonPost === true){
75
+ $this->headers[] = "Content-Type: application/json; charset=UTF-8";
76
  $this->callOptions[CURLOPT_POSTFIELDS] = json_encode($this->query, true);
77
  }else{
78
  $this->callOptions[CURLOPT_POSTFIELDS] = http_build_query($this->query, '', '&');
84
  }
85
  $this->callOptions[CURLOPT_URL] = $this->url.$query;
86
  }
87
+
88
+ if(!empty($this->headers)){
89
+ $this->callOptions[CURLOPT_HTTPHEADER] = $this->headers;
90
+ }
91
 
92
  ## Check for cURL
93
  if (!extension_loaded('curl')) {
117
  return $this->lastResult;
118
  }
119
 
120
+ public function doQuickCall($url, $query=array(), $method="GET", $headers = array()){
121
  $this->setDefaults();
122
  $this->setMethod($method);
123
  $this->setURL($url);
124
  $this->setQuery($query);
125
+ $this->headers = $headers;
126
  return $this->doCall();
127
  }
128
 
core/lrgawidget.class.php CHANGED
@@ -16,7 +16,6 @@ class LaraGoogleAnalyticsWidget {
16
  private $systemTimeZone;
17
  private $gapi;
18
  private $cache;
19
- private $cacheOutput;
20
  private $cachedOutput;
21
  private $cachePrefix;
22
  private $cacheTime;
@@ -26,11 +25,12 @@ class LaraGoogleAnalyticsWidget {
26
  private $settings = array();
27
  private $results = array();
28
  private $output = array();
29
- private $errors = array();
 
30
  private $cached;
 
31
  private $currentQueryParams;
32
  private $mdCurrentQueryParams;
33
- private $calculateTotalsFor;
34
  private $cacheEarningsOutput;
35
  private $earningsCacheTime;
36
 
@@ -38,13 +38,31 @@ class LaraGoogleAnalyticsWidget {
38
  $this->systemTimeZone = SystemBootStrap::getSystemTimeZone();
39
  $this->gapi = new GoogleAnalyticsAPI();
40
  $this->cache = true;
41
- $this->cacheOutput = true;
42
  $this->cachePrefix = "lrga_";
43
  $this->cacheTime = 3600;
44
- $this->dParams = array( 'metrics' => 'ga:sessions', 'sort' => '-ga:sessions');
45
- $this->calculateTotalsFor = "ga:sessions";
46
  $this->cacheEarningsOutput = true;
47
  $this->earningsCacheTime = 900;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
 
50
  private function getGraphObject(){
@@ -59,14 +77,28 @@ class LaraGoogleAnalyticsWidget {
59
  return $graphObject;
60
  }
61
 
62
- public function getSessions(){
63
- $this->params = array('metrics' => 'ga:sessions,ga:users,ga:pageviews, ga:percentNewSessions,ga:bounceRate,ga:avgSessionDuration,ga:pageviewsPerSession',
64
- 'dimensions' => 'ga:date',
65
- 'sort' => 'ga:date');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  $this->doCall();
67
 
68
  $cachedCall = array();
69
- if (($this->cacheOutput === true) && (!empty($this->mdCurrentQueryParams))){
70
  $cachedCall = DataStore::get_from_cache($this->cachePrefix, $this->mdCurrentQueryParams."_output", $this->cacheTime);
71
  }
72
 
@@ -74,38 +106,93 @@ class LaraGoogleAnalyticsWidget {
74
  $this->output = $cachedCall;
75
  $this->cachedOutput = true;
76
  }else{
77
- @array_walk($this->results['rows'], array($this, 'convertDate'));
78
- $plotData = array();
79
- foreach ($this->results['rows'] as $row){
80
- foreach ($row as $id => $value){
81
- if ($id === 1){$plotData['sessions'][] = array($row[0], $value); $plotData['sessions_sb'][] = $value;}
82
- elseif ($id === 2){$plotData['users'][] = array($row[0], $value); $plotData['users_sb'][] = $value;}
83
- elseif ($id === 3){$plotData['pageviews'][] = array($row[0], $value); $plotData['pageviews_sb'][] = $value;}
84
- elseif ($id === 4){$plotData['percentNewSessions'][] = array($row[0], $this->roundNumbers($value)); $plotData['percentNewSessions_sb'][] = $this->roundNumbers($value);}
85
- elseif ($id === 5){$plotData['bounceRate'][] = array($row[0], $this->roundNumbers($value)); $plotData['bounceRate_sb'][] = $this->roundNumbers($value);}
86
- elseif ($id === 6){$plotData['avgSessionDuration'][] = array($row[0],$this->roundNumbers($value)); $plotData['avgSessionDuration_sb'][] = $this->roundNumbers($value);}
87
- elseif ($id === 7){$plotData['pageviewsPerSession'][] = array($row[0], $this->roundNumbers($value)); $plotData['pageviewsPerSession_sb'][] = $this->roundNumbers($value);}
88
- }
89
  }
90
- $finalPlotData['sessions'] = array("label" => __('Sessions', 'lara-google-analytics'), "data" => $plotData['sessions'], "lrbefore"=>"", "lrafter"=>"", "lrformat"=>"");
91
- $finalPlotData['users'] = array("label" => __('Users', 'lara-google-analytics'), "data" => $plotData['users'], "lrbefore"=>"", "lrafter"=>"", "lrformat"=>"");
92
- $finalPlotData['pageviews'] = array("label" => __('Pageviews', 'lara-google-analytics'), "data" => $plotData['pageviews'], "lrbefore"=>"", "lrafter"=>"", "lrformat"=>"");
93
- $finalPlotData['percentNewSessions'] = array("label" => __('% New Sessions', 'lara-google-analytics'), "data" => $plotData['percentNewSessions'], "lrbefore"=>"", "lrafter"=>"%", "lrformat"=>"");
94
- $finalPlotData['bounceRate'] = array("label" => __('Bounce Rate', 'lara-google-analytics'), "data" => $plotData['bounceRate'], "lrbefore"=>"", "lrafter"=>"%", "lrformat"=>"");
95
- $finalPlotData['avgSessionDuration'] = array("label" => __('Avg. Session Duration', 'lara-google-analytics'), "data" => $plotData['avgSessionDuration'], "lrbefore"=>"", "lrafter"=>"", "lrformat"=>"seconds");
96
- $finalPlotData['pageviewsPerSession'] = array("label" => __('Pages / Session', 'lara-google-analytics'), "data" => $plotData['pageviewsPerSession'], "lrbefore"=>"", "lrafter"=>"", "lrformat"=>"");
97
 
98
- $totalsForAllResults['sessions'] = array("total" => $this->results['totalsForAllResults']['ga:sessions'], "data" => implode(",", $plotData['sessions_sb']));
99
- $totalsForAllResults['users'] = array("total" => $this->results['totalsForAllResults']['ga:users'], "data" => implode(",", $plotData['users_sb']));
100
- $totalsForAllResults['pageviews'] = array("total" => $this->results['totalsForAllResults']['ga:pageviews'], "data" => implode(",", $plotData['pageviews_sb']));
101
- $totalsForAllResults['percentNewSessions'] = array("total" => $this->roundNumbers($this->results['totalsForAllResults']['ga:percentNewSessions']), "data" => implode(",", $plotData['percentNewSessions_sb']));
102
- $totalsForAllResults['bounceRate'] = array("total" => $this->roundNumbers($this->results['totalsForAllResults']['ga:bounceRate']), "data" => implode(",", $plotData['bounceRate_sb']));
103
- $totalsForAllResults['avgSessionDuration'] = array("total" => gmdate("H:i:s", $this->results['totalsForAllResults']['ga:avgSessionDuration']), "data" => implode(",", $plotData['avgSessionDuration_sb']));
104
- $totalsForAllResults['pageviewsPerSession'] = array("total" => $this->roundNumbers($this->results['totalsForAllResults']['ga:pageviewsPerSession']), "data" => implode(",", $plotData['pageviewsPerSession_sb']));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
- $this->output = array ("plotdata" => $finalPlotData, "totalsForAllResults" =>$totalsForAllResults);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
- if (($this->cacheOutput === true) && (!empty($this->mdCurrentQueryParams))){
109
  DataStore::save_to_cache($this->cachePrefix, $this->mdCurrentQueryParams."_output", $this->output);
110
  }
111
  }
@@ -119,8 +206,10 @@ class LaraGoogleAnalyticsWidget {
119
  $graphOutput = array();
120
  if ($this->cacheEarningsOutput === true){
121
  $graphOutput = DataStore::get_from_cache($this->cachePrefix,"earnings_seriesData", $this->earningsCacheTime);
 
122
  }
123
  if (empty($graphOutput)){
 
124
  $graphObject = $this->getGraphObject();
125
  if (($graphObject !== false) && (is_object($graphObject))){
126
  $graphOutput = $graphObject->getGraphOutput();
@@ -133,6 +222,8 @@ class LaraGoogleAnalyticsWidget {
133
  if (!empty($graphOutput)){
134
  list($this->output['plotdata']['sales'], $this->output['plotdata']['earnings'],$this->output['graph']['settings']) = $graphOutput;
135
  }
 
 
136
  }
137
  }
138
 
@@ -162,61 +253,91 @@ class LaraGoogleAnalyticsWidget {
162
  }
163
 
164
  public function getBrowsers($lrdata){
165
- $this->params = array( 'dimensions' => 'ga:browser');
166
  $this->doCall(true);
167
  }
168
 
169
  public function getLanguages(){
170
- $this->params = array('dimensions' => 'ga:language');
171
  $this->doCall(true);
172
  }
173
 
174
  public function getOS($lrdata){
175
- $this->params = array( 'dimensions' => 'ga:operatingSystem');
176
  $this->doCall(true);
177
  }
178
 
179
  public function getDevices($lrdata){
180
- $this->params = array( 'dimensions' => 'ga:deviceCategory');
181
- $this->doCall(false);
182
-
183
- $this->calculateTotals();
184
- $this->jsonOutput();
185
-
186
  }
187
 
188
  public function getScreenResolution(){
189
- $this->params = array('dimensions' => 'ga:ScreenResolution');
190
  $this->doCall(true);
191
  }
192
 
193
  public function getPages(){
194
- $this->params = array('metrics' => 'ga:pageviews', 'dimensions' => 'ga:pagePath,ga:pageTitle,ga:hostname', 'sort' => '-ga:pageviews');
195
- $this->calculateTotalsFor = "ga:pageviews";
196
- $this->doCall(false);
197
-
198
- if (!empty($this->results['rows']) && is_array($this->results['rows'])){
199
- @array_walk($this->results['rows'], array($this, 'preparePagesOutput'));
200
- }
201
-
202
- $this->calculateTotals();
203
- $this->jsonOutput();
204
  }
205
 
206
  private function doCall($handleOutput=false){
207
  $this->checkSettings();
208
- $_params = array_merge($this->dParams, $this->params, $this->filters);
209
  $this->gapi->buildQuery($_params);
210
  $this->setCurrentQueryParms();
211
  $this->inCache($this->currentQueryParams);
212
  if (!$this->cached){
213
  $this->results = $this->gapi->doQuery();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  if ($this->cache){
215
  DataStore::save_to_cache($this->cachePrefix, $this->mdCurrentQueryParams, $this->results);
216
  }
217
  }
 
218
  if ($handleOutput){
219
- $this->calculateTotals();
220
  $this->jsonOutput();
221
  }
222
  }
@@ -239,15 +360,19 @@ class LaraGoogleAnalyticsWidget {
239
  }
240
 
241
  private function checkSettings (){
242
- if ( ($this->get_database_setting('client_id') === null) || ($this->get_database_setting('client_secret') === null) || ($this->get_database_setting('access_token')=== null) || ($this->get_database_setting('profile_id')=== null)){
243
  $this->output = array("setup" => 1);
244
  $this->jsonOutput();
 
 
 
245
  }
 
246
  if ( ($this->get_session_setting('start_date') !== null) && ($this->get_session_setting('end_date') !== null)){
247
  $this->setGapiValues(array( 'start_date' => $this->get_session_setting('start_date'),
248
  'end_date' => $this->get_session_setting('end_date')));
249
  }
250
- $this->setGapiValues(array('profile_id' => $this->get_database_setting('profile_id')));
251
  $this->refreshToken();
252
  }
253
 
@@ -258,20 +383,72 @@ class LaraGoogleAnalyticsWidget {
258
  $this->jsonOutput();
259
  }
260
 
261
- public function getProfiles(){
262
- $this->refreshToken();
263
- $this->results = $this->gapi->getAccounts();
264
- $this->output['all_accounts'] = $this->results['items'];
265
- $this->results = $this->gapi->getProfiles(array('fields' => 'items(id,timezone)'));
266
- $this->output['all_profiles'] = $this->results['items'];
267
 
268
- DataStore::save_to_cache($this->cachePrefix, md5('all_accounts_and_profiles')."_output", $this->output);
 
 
 
 
 
 
 
 
 
 
 
 
 
269
 
270
- $this->output['current_selected'] = array("account_id" => $this->get_database_setting('account_id'),
271
- "property_id" => $this->get_database_setting('property_id'),
272
- "profile_id" => $this->get_database_setting('profile_id'),
273
- "profile_timezone" => $this->get_database_setting('profile_timezone'),
274
- "lock_settings" => $this->get_database_setting('lock_settings'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  $this->jsonOutput();
276
  }
277
 
@@ -304,20 +481,22 @@ class LaraGoogleAnalyticsWidget {
304
  }
305
 
306
 
307
- public function setProfileID($lrdata){
308
- $data = DataStore::get_from_cache($this->cachePrefix, md5('all_accounts_and_profiles')."_output", $this->cacheTime);
309
- $selectedProfile = array();
310
 
311
- if (!empty($data['all_accounts']) && is_array($data['all_accounts'])){
312
- foreach ($data['all_accounts'] as $account){
313
  if ($account['id'] == $lrdata['account_id']){
314
- $selectedProfile['account_id'] = $account['id'];
315
- foreach ($account['webProperties'] as $webProperty){
316
- if ($webProperty['id'] == $lrdata['property_id']){
317
- $selectedProfile['property_id'] = $webProperty['id'];
318
- foreach ($webProperty['profiles'] as $profile){
319
- if ($profile['id'] == $lrdata['profile_id']){
320
- $selectedProfile['profile_id'] = $profile['id'];
 
 
321
  break;
322
  }
323
  }
@@ -329,30 +508,21 @@ class LaraGoogleAnalyticsWidget {
329
  }
330
  }
331
 
332
- if (!empty($data['all_profiles']) && is_array($data['all_profiles'])){
333
- foreach ($data['all_profiles'] as $profileTm){
334
- if ($profileTm['id'] == $lrdata['profile_id']){
335
- $selectedProfile['profile_timezone'] = $profileTm['timezone'];
336
- break;
337
- }
338
- }
339
- }
340
-
341
 
342
- if(empty($selectedProfile['account_id'])){$this->errors[] = "Invalid Account ID";}
343
- if(empty($selectedProfile['property_id'])){$this->errors[] = "Invalid Property ID";}
344
- if(empty($selectedProfile['profile_id'])){$this->errors[] = "Invalid Profile ID";}
345
- if(empty($selectedProfile['profile_timezone'])){$this->errors[] = "Invalid Profile Timezone";}
346
  if (empty($this->errors)){
347
- $this->set_database_setting(array('account_id' => $selectedProfile['account_id'],
348
- 'property_id' => $selectedProfile['property_id'],
349
- 'profile_id' => $selectedProfile['profile_id'],
350
- 'profile_timezone' => $selectedProfile['profile_timezone']));
351
 
352
- if(!empty($lrdata['enable_universal_tracking']) && $lrdata['enable_universal_tracking'] === "on"){
353
- $this->set_database_setting(array('enable_universal_tracking' => 'on'));
354
  }else{
355
- $this->set_database_setting(array('enable_universal_tracking' => 'off'));
356
  }
357
 
358
  if(!empty($lrdata['enable_ecommerce_graph']) && $lrdata['enable_ecommerce_graph'] === "on"){
@@ -417,43 +587,31 @@ class LaraGoogleAnalyticsWidget {
417
  }
418
  }
419
 
420
- private function calculateTotals(){
421
- if (isset($this->results['rows'])){
422
- $totalSessions = $this->results['totalsForAllResults'][$this->calculateTotalsFor];
423
- foreach ($this->results["rows"] as $index => $record){
424
- $this->results["rows"][$index][] = number_format(((end($record)*100)/$totalSessions),2);
425
- }
426
- $this->output = $this->results["rows"];
427
- }
428
  }
429
 
430
- private function preparePagesOutput(&$item){
431
- if (strpos($item[0], '/') === 0) {$item[0] = $item[2].$item[0];}
432
- $item[0] = array(htmlspecialchars($item[0]),htmlspecialchars($item[1]));
433
- $item[1] = $item[3];
434
- unset($item[2]);
435
- unset($item[3]);
436
- $item = array_values($item);
437
  }
438
-
439
- private function array_find($needle, array $haystack){
440
- foreach ($haystack as $key => $value) {
441
- if (false !== stripos($value, $needle)) {
442
- return true;
 
 
 
 
443
  }
444
  }
445
- return false;
446
- }
447
-
448
- private function convertDate(&$item){
449
- $item[0] = strtotime($item[0]." UTC") * 1000;
450
  }
451
 
452
- private function roundNumbers($num){
453
- $rounded = floor($num * 100) / 100 ;
454
- return $rounded;
455
- }
456
-
457
  private function jsonOutput(){
458
  @ini_set('precision', 14);
459
  @ini_set('serialize_precision', 14);
@@ -461,7 +619,6 @@ class LaraGoogleAnalyticsWidget {
461
  if ($this->cached){ $this->output['cached'] = "true";}
462
  if ($this->cachedOutput){ $this->output['cachedOutput'] = "true";}
463
  $this->output['system_timezone'] = $this->systemTimeZone;
464
- $this->output['gaview_timezone'] = $this->get_database_setting('profile_timezone');
465
  $this->output['start'] = $this->get_session_setting('start_date');
466
  $this->output['end'] = $this->get_session_setting('end_date');
467
  $this->output['status'] = "done";
16
  private $systemTimeZone;
17
  private $gapi;
18
  private $cache;
 
19
  private $cachedOutput;
20
  private $cachePrefix;
21
  private $cacheTime;
25
  private $settings = array();
26
  private $results = array();
27
  private $output = array();
28
+ private $errors = array();
29
+ private $metrics = array();
30
  private $cached;
31
+ private $base_metric;
32
  private $currentQueryParams;
33
  private $mdCurrentQueryParams;
 
34
  private $cacheEarningsOutput;
35
  private $earningsCacheTime;
36
 
38
  $this->systemTimeZone = SystemBootStrap::getSystemTimeZone();
39
  $this->gapi = new GoogleAnalyticsAPI();
40
  $this->cache = true;
 
41
  $this->cachePrefix = "lrga_";
42
  $this->cacheTime = 3600;
43
+ $this->setBaseMetric("activeUsers");
 
44
  $this->cacheEarningsOutput = true;
45
  $this->earningsCacheTime = 900;
46
+ $this->metrics = array("activeUsers" => array( "label" => __('Active Users', 'lara-google-analytics')),
47
+ "newUsers" => array( "label" => __('New Users', 'lara-google-analytics')),
48
+ "sessions" => array( "label" => __('Sessions', 'lara-google-analytics')),
49
+ "screenPageViews" => array( "label" => __('Screen Page Views', 'lara-google-analytics')),
50
+ "eventCount" => array( "label" => __('Event Count', 'lara-google-analytics')),
51
+ "userEngagementDuration" => array( "label" => __('Average Engagement Time', 'lara-google-analytics'),
52
+ "lrformat" => "seconds",
53
+ "total" => "average" ),
54
+ "bounceRate" => array( "label" => __('Bounce Rate', 'lara-google-analytics'),
55
+ "lrafter" => "%",
56
+ "lrformat" => "percentage",
57
+ "total" => "average" ),
58
+ );
59
+
60
+ }
61
+
62
+ private function setBaseMetric($base_metric){
63
+ $this->base_metric = $base_metric;
64
+ $this->dParams = array( "keepEmptyRows" => TRUE, "metrics" => array(array("name" => $this->base_metric)));
65
+
66
  }
67
 
68
  private function getGraphObject(){
77
  return $graphObject;
78
  }
79
 
80
+ public function getMainGraph(){
81
+
82
+ $this->params = [ "metrics" => [
83
+ ["name" => "newUsers"],
84
+ ["name" => "sessions"],
85
+ ["name" => "screenPageViews"],
86
+ ["name" => "eventCount"],
87
+ ["name" => "userEngagementDuration"],
88
+ ["name" => "bounceRate"],
89
+ ],
90
+ "dimensions" => [
91
+ ["name" => "date"]
92
+ ],
93
+ "orderBys" => [
94
+ ["dimension" => ["dimensionName" => "date"]]
95
+ ]
96
+ ];
97
+
98
  $this->doCall();
99
 
100
  $cachedCall = array();
101
+ if (($this->cache === true) && (!empty($this->mdCurrentQueryParams))){
102
  $cachedCall = DataStore::get_from_cache($this->cachePrefix, $this->mdCurrentQueryParams."_output", $this->cacheTime);
103
  }
104
 
106
  $this->output = $cachedCall;
107
  $this->cachedOutput = true;
108
  }else{
109
+
110
+ $date_range = array();
111
+ $start_date = new \DateTime($this->get_session_setting('start_date'));
112
+ $end_date = new \DateTime($this->get_session_setting('end_date'));
113
+ $period = new \DatePeriod($start_date, new \DateInterval('P1D'), $end_date->modify( '+1 day' ));
114
+ $periods = iterator_to_array($period);
115
+ foreach($periods as $date) {
116
+ $d = strtotime($date->format('Ymd') . " UTC" ) * 1000;
117
+ $date_range[$d] = array($d, 0);
 
 
 
118
  }
 
 
 
 
 
 
 
119
 
120
+ $processed_results = array();
121
+ foreach($this->results["metricHeaders"] as $id => $metric){
122
+ $processed_results["plotdata"][$metric["name"]] = array("label" => $this->metrics[$metric["name"]]["label"],
123
+ "data" => $date_range,
124
+ "lrbefore" => "",
125
+ "lrafter" => "",
126
+ "lrformat" => "");
127
+ $processed_results["totalsForAllResults"][$metric["name"]] = array("label" => $this->metrics[$metric["name"]]["label"],
128
+ "data" => array(),
129
+ "rawData" => array(),
130
+ "total" => 0 );
131
+ }
132
+
133
+ if((!empty($this->results["rows"]) && (is_array($this->results["rows"])))){
134
+ foreach ($this->results["rows"] as $row){
135
+ $date = strtotime($row["dimensionValues"][0]["value"]." UTC") * 1000;
136
+ foreach($this->results["metricHeaders"] as $id => $metric){
137
+ $raw_value = $row["metricValues"][$id]["value"];
138
+ $value = $raw_value;
139
+
140
+ if($metric["name"] === "userEngagementDuration"){
141
+ $activeUsers = intval($row["metricValues"][0]["value"]);
142
+ if( $activeUsers > 0 ){
143
+ $value = intval($value/$activeUsers);
144
+ $raw_value = $raw_value/$row["metricValues"][0]["value"];
145
+ }
146
+ }
147
+
148
+ if(!empty($this->metrics[$metric["name"]]["lrformat"])){
149
+ if($this->metrics[$metric["name"]]["lrformat"] === "percentage"){
150
+ $value = number_format((float)$value * 100, 1, '.', '');
151
+ }
152
+ }
153
+ $processed_results["plotdata"][$metric["name"]]["data"][$date] = array($date, $value);
154
+ $processed_results["totalsForAllResults"][$metric["name"]]["total"] = $processed_results["totalsForAllResults"][$metric["name"]]["total"] + $value;
155
+ $processed_results["totalsForAllResults"][$metric["name"]]["rawData"][] = $raw_value;
156
+ }
157
+ }
158
+ }
159
+
160
 
161
+ foreach($processed_results["plotdata"] as $metric => $data){
162
+ $processed_results["plotdata"][$metric]["data"] = array_values($processed_results["plotdata"][$metric]["data"]);
163
+ if(!empty($this->metrics[$metric]["lrbefore"])){$processed_results["plotdata"][$metric]["lrbefore"] = $this->metrics[$metric]["lrbefore"];}
164
+ if(!empty($this->metrics[$metric]["lrafter"])) {$processed_results["plotdata"][$metric]["lrafter"] = $this->metrics[$metric]["lrafter"];}
165
+ if(!empty($this->metrics[$metric]["lrformat"])){$processed_results["plotdata"][$metric]["lrformat"] = $this->metrics[$metric]["lrformat"];}
166
+ foreach($processed_results["plotdata"][$metric]["data"] as $mdata){
167
+ $processed_results["totalsForAllResults"][$metric]["data"][] = $mdata[1];
168
+ }
169
+ }
170
+
171
+ foreach($processed_results["totalsForAllResults"] as $id => $metric){
172
+ $total = $processed_results["totalsForAllResults"][$id]["total"];
173
+ if(!empty($this->metrics[$id]["total"])){
174
+ if($this->metrics[$id]["total"] === "average"){
175
+ $total = $this->calculateAverage($processed_results["totalsForAllResults"][$id]["rawData"]);
176
+ unset($processed_results["totalsForAllResults"][$id]["rawData"]);
177
+ }
178
+ }else{
179
+ $total = $this->shorten($total);
180
+ }
181
+ if(!empty($this->metrics[$id]["lrformat"])){
182
+ if($this->metrics[$id]["lrformat"] === "seconds"){
183
+ $total = gmdate("H:i:s", round($total));
184
+ }elseif ($this->metrics[$id]["lrformat"] === "percentage"){
185
+ $total = number_format((float)$total * 100, 1, '.', '') . "%";
186
+ }
187
+ }
188
+
189
+ $processed_results["totalsForAllResults"][$id]["total"] = $total;
190
+ $processed_results["totalsForAllResults"][$id]["data"] = implode(",", $processed_results["totalsForAllResults"][$id]["data"]);
191
+ }
192
+
193
+ $this->output = $processed_results;
194
 
195
+ if (($this->cache === true) && (!empty($this->mdCurrentQueryParams))){
196
  DataStore::save_to_cache($this->cachePrefix, $this->mdCurrentQueryParams."_output", $this->output);
197
  }
198
  }
206
  $graphOutput = array();
207
  if ($this->cacheEarningsOutput === true){
208
  $graphOutput = DataStore::get_from_cache($this->cachePrefix,"earnings_seriesData", $this->earningsCacheTime);
209
+ $cached = true;
210
  }
211
  if (empty($graphOutput)){
212
+ $cached = false;
213
  $graphObject = $this->getGraphObject();
214
  if (($graphObject !== false) && (is_object($graphObject))){
215
  $graphOutput = $graphObject->getGraphOutput();
222
  if (!empty($graphOutput)){
223
  list($this->output['plotdata']['sales'], $this->output['plotdata']['earnings'],$this->output['graph']['settings']) = $graphOutput;
224
  }
225
+
226
+ $this->output['getearnings'] = $cached;
227
  }
228
  }
229
 
253
  }
254
 
255
  public function getBrowsers($lrdata){
256
+ $this->params = array( "dimensions" => array(array("name" => "browser")));
257
  $this->doCall(true);
258
  }
259
 
260
  public function getLanguages(){
261
+ $this->params = array( "dimensions" => array(array("name" => "language")));
262
  $this->doCall(true);
263
  }
264
 
265
  public function getOS($lrdata){
266
+ $this->params = array( "dimensions" => array(array("name" => "operatingSystem")));
267
  $this->doCall(true);
268
  }
269
 
270
  public function getDevices($lrdata){
271
+ $this->params = array( "dimensions" => array(array("name" => "deviceCategory")));
272
+ $this->doCall(true);
 
 
 
 
273
  }
274
 
275
  public function getScreenResolution(){
276
+ $this->params = array( "dimensions" => array(array("name" => "ScreenResolution")));
277
  $this->doCall(true);
278
  }
279
 
280
  public function getPages(){
281
+ $this->setBaseMetric("screenPageViews");
282
+ $this->params = array( "dimensions" => array(array("name" => "hostName"),array("name" => "pagePath"),array("name" => "pageTitle")) );
283
+ $this->doCall(true);
 
 
 
 
 
 
 
284
  }
285
 
286
  private function doCall($handleOutput=false){
287
  $this->checkSettings();
288
+ $_params = array_merge_recursive($this->dParams, $this->params, $this->filters);
289
  $this->gapi->buildQuery($_params);
290
  $this->setCurrentQueryParms();
291
  $this->inCache($this->currentQueryParams);
292
  if (!$this->cached){
293
  $this->results = $this->gapi->doQuery();
294
+ if ($handleOutput){
295
+ $processed_results = array("table_data" => array(), "total" => 0);
296
+ if((!empty($this->results["rows"]) && (is_array($this->results["rows"])))){
297
+ foreach ($this->results["rows"] as $row){
298
+ $processed_row = array();
299
+
300
+ if($this->base_metric === "screenPageViews"){
301
+ $processed_row[] = array($row["dimensionValues"][0]["value"] . $row["dimensionValues"][1]["value"], $row["dimensionValues"][2]["value"]);//escape html
302
+ }else{
303
+ foreach($this->results["dimensionHeaders"] as $id => $dimension){
304
+ $value = $row["dimensionValues"][$id]["value"];
305
+ if($dimension["name"] === "deviceCategory"){
306
+ $value = ucwords($value);
307
+ }
308
+ $processed_row[] = $value;
309
+ }
310
+ }
311
+
312
+ foreach($this->results["metricHeaders"] as $id => $metric){
313
+ $processed_row[] = $row["metricValues"][$id]["value"];
314
+ if($metric["name"] === $this->base_metric ){
315
+ $processed_results["total"] = $processed_results["total"] + $row["metricValues"][$id]["value"];
316
+ }
317
+ }
318
+ array_walk_recursive($processed_row, array($this, 'html_escape'));
319
+ $processed_results["table_data"][] = $processed_row;
320
+
321
+ }
322
+
323
+ foreach ($processed_results["table_data"] as $index => $record){
324
+ if(!empty($this->filters)){
325
+ unset($processed_results["table_data"][$index][0]);
326
+ $processed_results["table_data"][$index] = array_values($processed_results["table_data"][$index]);
327
+ }
328
+ $processed_results["table_data"][$index][] = number_format(((end($record)*100)/$processed_results["total"]),2);
329
+ }
330
+ }
331
+ $this->results = $processed_results;
332
+ }
333
+
334
  if ($this->cache){
335
  DataStore::save_to_cache($this->cachePrefix, $this->mdCurrentQueryParams, $this->results);
336
  }
337
  }
338
+
339
  if ($handleOutput){
340
+ $this->output = $this->results;
341
  $this->jsonOutput();
342
  }
343
  }
360
  }
361
 
362
  private function checkSettings (){
363
+ if ( ($this->get_database_setting('client_id') === null) || ($this->get_database_setting('client_secret') === null) || ($this->get_database_setting('access_token')=== null) ) {
364
  $this->output = array("setup" => 1);
365
  $this->jsonOutput();
366
+ }elseif ($this->get_database_setting('measurementId') === null || $this->get_database_setting('property_id') === null){
367
+ $this->output = array("setup" => 2);
368
+ $this->jsonOutput();
369
  }
370
+
371
  if ( ($this->get_session_setting('start_date') !== null) && ($this->get_session_setting('end_date') !== null)){
372
  $this->setGapiValues(array( 'start_date' => $this->get_session_setting('start_date'),
373
  'end_date' => $this->get_session_setting('end_date')));
374
  }
375
+ $this->setGapiValues(array('property_id' => $this->get_database_setting('property_id')));
376
  $this->refreshToken();
377
  }
378
 
383
  $this->jsonOutput();
384
  }
385
 
386
+ public function getAccountSummaries($lrdata){
387
+ $this->output['current_selected'] = array("account_id" => $this->get_database_setting('account_id'),
388
+ "property_id" => $this->get_database_setting('property_id'),
389
+ "datastream_id" => $this->get_database_setting('datastream_id'),
390
+ "measurementId" => $this->get_database_setting('measurementId'));
 
391
 
392
+ if(!empty($this->output['current_selected']["property_id"]) && empty($lrdata["pid"])){
393
+ $lrdata["pid"] = $this->output['current_selected']["property_id"];
394
+ }
395
+ $this->refreshToken();
396
+
397
+ if(!empty($lrdata["purge"]) && $lrdata["purge"] === "true"){
398
+ $this->purgeCache();
399
+ }
400
+
401
+ $this->results = DataStore::get_from_cache($this->cachePrefix, md5('accountSummaries'), $this->cacheTime);
402
+ if (empty($this->results['accountSummaries'])){
403
+ $this->results = $this->gapi->getAccounts();
404
+ DataStore::save_to_cache($this->cachePrefix, md5('accountSummaries'), $this->results);
405
+ }else{$this->output['accountSummaries_cache'] = true;}
406
 
407
+ if (!empty($this->results['accountSummaries']) && is_array($this->results['accountSummaries'])){
408
+ foreach ($this->results['accountSummaries'] as $account){
409
+ $account_id = str_replace("accounts/", "", $account['account']);
410
+ $this->output['accountSummaries'][$account_id] = array( "id" => $account_id,
411
+ "displayName" => $account['displayName']);
412
+ if (!empty($account['propertySummaries']) && is_array($account['propertySummaries'])){
413
+ foreach ($account['propertySummaries'] as $property){
414
+ $property_id = str_replace("properties/", "", $property['property']);
415
+ $this->output['accountSummaries'][$account_id]["properties"][$property_id] = array( "id" => $property_id,
416
+ "displayName" => $property['displayName']);
417
+ if(!empty($lrdata["pid"]) && $lrdata["pid"] === $property_id){
418
+ $this->output['current_selected']["account_id"] = $account_id;
419
+ $this->output['current_selected']["property_id"] = $property_id;
420
+ $results = $this->gapi->getProperty($property_id);
421
+ if(!empty($results["timeZone"])){
422
+ $this->output['accountSummaries'][$account_id]["properties"][$property_id]["timeZone"] = $results["timeZone"];
423
+ }
424
+ $results = $this->gapi->getDataStreams($property_id);
425
+ if(!empty($results["dataStreams"]) && is_array($results["dataStreams"])){
426
+ foreach ($results["dataStreams"] as $dataStream){
427
+ if(!empty($dataStream['webStreamData'])){
428
+ $dataStream_id = str_replace("properties/" . $property_id . "/dataStreams/", "", $dataStream["name"]);
429
+ $measurement_id = "G-" . strtoupper(ltrim(strtolower($dataStream['webStreamData']["measurementId"]),"g-"));
430
+ $this->output['accountSummaries'][$account_id]["properties"][$property_id]["dataStreams"][$dataStream_id] = array( "id" => $dataStream_id,
431
+ "type" => $dataStream['type'],
432
+ "displayName" => $dataStream['displayName'],
433
+ "measurementId" => $measurement_id,
434
+ "defaultUri" => $dataStream['webStreamData']["defaultUri"]);
435
+ }
436
+ }
437
+ if(!empty($this->output['accountSummaries'][$account_id]["properties"][$property_id]["dataStreams"])){
438
+ if (array_key_exists($this->output['current_selected']["datastream_id"], $this->output['accountSummaries'][$account_id]["properties"][$property_id]["dataStreams"]) !== true) {
439
+ $ds = array_key_first($this->output['accountSummaries'][$account_id]["properties"][$property_id]["dataStreams"]);
440
+ $this->output['current_selected']["datastream_id"] = $this->output['accountSummaries'][$account_id]["properties"][$property_id]["dataStreams"][$ds]["id"];
441
+ $this->output['current_selected']["measurementId"] = $this->output['accountSummaries'][$account_id]["properties"][$property_id]["dataStreams"][$ds]["measurementId"];
442
+ }
443
+ }
444
+ }
445
+ }
446
+ }
447
+ }else{unset($this->output['accountSummaries'][$account_id]);}
448
+ }
449
+ }
450
+
451
+ DataStore::save_to_cache($this->cachePrefix, md5('accountSummaries')."_output", $this->output);
452
  $this->jsonOutput();
453
  }
454
 
481
  }
482
 
483
 
484
+ public function setMeasurementID($lrdata){
485
+ $data = DataStore::get_from_cache($this->cachePrefix, md5('accountSummaries')."_output", $this->cacheTime);
486
+ $selectedDataStream = array();
487
 
488
+ if (!empty($data['accountSummaries']) && is_array($data['accountSummaries'])){
489
+ foreach ($data['accountSummaries'] as $account){
490
  if ($account['id'] == $lrdata['account_id']){
491
+ $selectedDataStream['account_id'] = $account['id'];
492
+ foreach ($account['properties'] as $property){
493
+ if ($property['id'] == $lrdata['property_id']){
494
+ $selectedDataStream['property_id'] = $property['id'];
495
+ $selectedDataStream['property_timezone'] = $property['timeZone'];
496
+ foreach ($property['dataStreams'] as $dataStream){
497
+ if ($dataStream['id'] == $lrdata['datastream_id']){
498
+ $selectedDataStream['datastream_id'] = $dataStream['id'];
499
+ $selectedDataStream['measurementId'] = $dataStream['measurementId'];
500
  break;
501
  }
502
  }
508
  }
509
  }
510
 
 
 
 
 
 
 
 
 
 
511
 
512
+ if(empty($selectedDataStream['account_id'])){$this->errors[] = "Invalid Account ID";}
513
+ if(empty($selectedDataStream['property_id'])){$this->errors[] = "Invalid Property ID";}
514
+ if(empty($selectedDataStream['datastream_id'])){$this->errors[] = "Invalid Data Stream ID";}
515
+ if(empty($selectedDataStream['measurementId'])){$this->errors[] = "Invalid Measurement ID";}
516
  if (empty($this->errors)){
517
+ $this->set_database_setting(array('account_id' => $selectedDataStream['account_id'],
518
+ 'property_id' => $selectedDataStream['property_id'],
519
+ 'datastream_id' => $selectedDataStream['datastream_id'],
520
+ "measurementId" => $selectedDataStream['measurementId']));
521
 
522
+ if(!empty($lrdata['enable_ga4_tracking']) && $lrdata['enable_ga4_tracking'] === "on"){
523
+ $this->set_database_setting(array('enable_ga4_tracking' => 'on'));
524
  }else{
525
+ $this->set_database_setting(array('enable_ga4_tracking' => 'off'));
526
  }
527
 
528
  if(!empty($lrdata['enable_ecommerce_graph']) && $lrdata['enable_ecommerce_graph'] === "on"){
587
  }
588
  }
589
 
590
+ private function html_escape(&$item){
591
+ $item = htmlspecialchars($item);
 
 
 
 
 
 
592
  }
593
 
594
+ private function calculateAverage($arr){
595
+ $average = 0;
596
+ $arr = array_filter($arr);
597
+ if(count($arr)) {
598
+ $average = array_sum($arr)/count($arr);
599
+ }
600
+ return $average;
601
  }
602
+
603
+ private function shorten($number){
604
+ $suffix = ['', 'K', 'M', 'B', 'T', 'Qa', 'Qi'];
605
+ $precision = 1;
606
+ for($i = 0; $i < count($suffix); $i++){
607
+ $divide = $number / pow(1000, $i);
608
+ if($divide < 1000){
609
+ return round($divide, $precision).$suffix[$i];
610
+ break;
611
  }
612
  }
 
 
 
 
 
613
  }
614
 
 
 
 
 
 
615
  private function jsonOutput(){
616
  @ini_set('precision', 14);
617
  @ini_set('serialize_precision', 14);
619
  if ($this->cached){ $this->output['cached'] = "true";}
620
  if ($this->cachedOutput){ $this->output['cachedOutput'] = "true";}
621
  $this->output['system_timezone'] = $this->systemTimeZone;
 
622
  $this->output['start'] = $this->get_session_setting('start_date');
623
  $this->output['end'] = $this->get_session_setting('end_date');
624
  $this->output['status'] = "done";
core/lrgawidget.handler.php CHANGED
@@ -55,20 +55,20 @@ if (isset($lrdata['action'])){
55
  if (in_array("admin", DataStore::$RUNTIME["permissions"])){$call->getAccessToken($lrdata);}
56
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
57
  break;
58
- case "lrgawidget_getProfiles":
59
- if (in_array("admin", DataStore::$RUNTIME["permissions"])){$call->getProfiles();}
60
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
61
  break;
62
- case "lrgawidget_setProfileID":
63
- if (in_array("admin", DataStore::$RUNTIME["permissions"])){ $call->setProfileID($lrdata);}
64
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
65
  break;
66
  case "lrgawidget_settingsReset":
67
  if (in_array("admin", DataStore::$RUNTIME["permissions"])){ $call->settingsReset();}
68
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
69
  break;
70
- case "lrgawidget_getSessions":
71
- if (in_array("sessions", DataStore::$RUNTIME["permissions"])){$call->getSessions();}
72
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
73
  break;
74
  case "lrgawidget_getPages":
55
  if (in_array("admin", DataStore::$RUNTIME["permissions"])){$call->getAccessToken($lrdata);}
56
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
57
  break;
58
+ case "lrgawidget_getAccountSummaries":
59
+ if (in_array("admin", DataStore::$RUNTIME["permissions"])){$call->getAccountSummaries($lrdata);}
60
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
61
  break;
62
+ case "lrgawidget_setMeasurementID":
63
+ if (in_array("admin", DataStore::$RUNTIME["permissions"])){ $call->setMeasurementID($lrdata);}
64
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
65
  break;
66
  case "lrgawidget_settingsReset":
67
  if (in_array("admin", DataStore::$RUNTIME["permissions"])){ $call->settingsReset();}
68
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
69
  break;
70
+ case "lrgawidget_getMainGraph":
71
+ if (in_array("sessions", DataStore::$RUNTIME["permissions"])){$call->getMainGraph();}
72
  else{ ErrorHandler::FatalError(__('You do not have permission to access this tab!', 'lara-google-analytics'));}
73
  break;
74
  case "lrgawidget_getPages":
core/lrgawidget.permissions.php CHANGED
@@ -36,7 +36,7 @@ class Permissions{
36
  "default" => "",
37
  "permissions" => array(array("name" => "daterange", "label" => __('Change Date Range', 'lara-google-analytics')),
38
  array("name" => "graph_options","label" => __('Edit Graph Options', 'lara-google-analytics')),
39
- array("name" => "sessions", "label" => __('Sessions', 'lara-google-analytics')),
40
  array("name" => "realtime", "label" => __('Real Time', 'lara-google-analytics')),
41
  array("name" => "countries", "label" => __('Countries', 'lara-google-analytics')),
42
  array("name" => "browsers", "label" => __('Browsers', 'lara-google-analytics')),
36
  "default" => "",
37
  "permissions" => array(array("name" => "daterange", "label" => __('Change Date Range', 'lara-google-analytics')),
38
  array("name" => "graph_options","label" => __('Edit Graph Options', 'lara-google-analytics')),
39
+ array("name" => "sessions", "label" => __('Graph', 'lara-google-analytics')),
40
  array("name" => "realtime", "label" => __('Real Time', 'lara-google-analytics')),
41
  array("name" => "countries", "label" => __('Countries', 'lara-google-analytics')),
42
  array("name" => "browsers", "label" => __('Browsers', 'lara-google-analytics')),
core/system/wordpress/admin.actions.php CHANGED
@@ -15,10 +15,10 @@ add_action( 'admin_enqueue_scripts', 'Lara\Widgets\GoogleAnalytics\lrgawidget_en
15
  add_action( 'wp_ajax_lrgawidget_hideShowWidget', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
16
  add_action( 'wp_ajax_lrgawidget_getAuthURL', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
17
  add_action( 'wp_ajax_lrgawidget_getAccessToken', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
18
- add_action( 'wp_ajax_lrgawidget_getProfiles', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
19
- add_action( 'wp_ajax_lrgawidget_setProfileID', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
20
  add_action( 'wp_ajax_lrgawidget_settingsReset', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
21
- add_action( 'wp_ajax_lrgawidget_getSessions', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
22
  add_action( 'wp_ajax_lrgawidget_getBrowsers', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
23
  add_action( 'wp_ajax_lrgawidget_getLanguages', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
24
  add_action( 'wp_ajax_lrgawidget_getOS', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
15
  add_action( 'wp_ajax_lrgawidget_hideShowWidget', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
16
  add_action( 'wp_ajax_lrgawidget_getAuthURL', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
17
  add_action( 'wp_ajax_lrgawidget_getAccessToken', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
18
+ add_action( 'wp_ajax_lrgawidget_getAccountSummaries', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
19
+ add_action( 'wp_ajax_lrgawidget_setMeasurementID', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
20
  add_action( 'wp_ajax_lrgawidget_settingsReset', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
21
+ add_action( 'wp_ajax_lrgawidget_getMainGraph', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
22
  add_action( 'wp_ajax_lrgawidget_getBrowsers', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
23
  add_action( 'wp_ajax_lrgawidget_getLanguages', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
24
  add_action( 'wp_ajax_lrgawidget_getOS', 'Lara\Widgets\GoogleAnalytics\lrgawidget_callback' );
core/system/wordpress/tracking.code.class.php CHANGED
@@ -24,7 +24,7 @@ class TrackingCode {
24
  }
25
 
26
  private static function is_analytics($str){
27
- return (bool) preg_match('/^ua-\d{4,20}(-\d{1,10})?$/i', $str);
28
  }
29
 
30
 
@@ -41,18 +41,18 @@ class TrackingCode {
41
 
42
  public static function get_ga_code(){
43
  $settings = self::get_settings();
44
- if (!empty($settings["enable_universal_tracking"]) && $settings["enable_universal_tracking"] === "on"){
45
- if(!empty($settings["property_id"]) && self::is_analytics($settings["property_id"])){
46
- $property_id = $settings["property_id"];
47
  ?>
48
 
49
  <!-- Lara's Google Analytics - https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/ -->
50
- <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $property_id ?>"></script>
51
  <script>
52
  window.dataLayer = window.dataLayer || [];
53
  function gtag(){dataLayer.push(arguments);}
54
  gtag('js', new Date());
55
- gtag('config', '<?php echo $property_id ?>', { 'anonymize_ip': true });
56
  </script>
57
 
58
  <?php
24
  }
25
 
26
  private static function is_analytics($str){
27
+ return (bool) preg_match('/^g-[a-z0-9]+$/i', $str);
28
  }
29
 
30
 
41
 
42
  public static function get_ga_code(){
43
  $settings = self::get_settings();
44
+ if (!empty($settings["enable_ga4_tracking"]) && $settings["enable_ga4_tracking"] === "on"){
45
+ if(!empty($settings["measurementId"]) && self::is_analytics($settings["measurementId"])){
46
+ $measurement_id = $settings["measurementId"];
47
  ?>
48
 
49
  <!-- Lara's Google Analytics - https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/ -->
50
+ <script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo $measurement_id ?>"></script>
51
  <script>
52
  window.dataLayer = window.dataLayer || [];
53
  function gtag(){dataLayer.push(arguments);}
54
  gtag('js', new Date());
55
+ gtag('config', '<?php echo $measurement_id ?>', { 'anonymize_ip': true });
56
  </script>
57
 
58
  <?php
dist/css/lrgalite-main.css CHANGED
@@ -9456,6 +9456,10 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:las
9456
  width: 200px;
9457
  }
9458
 
 
 
 
 
9459
  .lrgawidget-settings-pro {
9460
  background-color: #EEF7FB;
9461
  margin: 15px 0px 10px 0px !important;
@@ -9475,6 +9479,7 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:las
9475
 
9476
  #lrgawidget_realtime_activenow .lrgawidget_realtime_rn{
9477
  font-size: 200%;
 
9478
  }
9479
 
9480
  #lrgawidget_rttotal{
@@ -9503,7 +9508,7 @@ div.table-responsive > div.dataTables_wrapper > div.row > div[class^="col-"]:las
9503
  height: 10px;
9504
  margin-right:5px;
9505
  border-radius: 1px;
9506
- margin-top: 3px;
9507
  }
9508
 
9509
  .lrgawidget_realtime_dpbar {
9456
  width: 200px;
9457
  }
9458
 
9459
+ #lrgawidget_settings_tab select:disabled{
9460
+ background-image: none !important;
9461
+ }
9462
+
9463
  .lrgawidget-settings-pro {
9464
  background-color: #EEF7FB;
9465
  margin: 15px 0px 10px 0px !important;
9479
 
9480
  #lrgawidget_realtime_activenow .lrgawidget_realtime_rn{
9481
  font-size: 200%;
9482
+ margin-top: 15px;
9483
  }
9484
 
9485
  #lrgawidget_rttotal{
9508
  height: 10px;
9509
  margin-right:5px;
9510
  border-radius: 1px;
9511
+ margin-top: 5px;
9512
  }
9513
 
9514
  .lrgawidget_realtime_dpbar {
dist/css/lrgawidget.css CHANGED
@@ -2034,6 +2034,10 @@
2034
  width: 200px;
2035
  }
2036
 
 
 
 
 
2037
  .lrgawidget-settings-pro {
2038
  background-color: #EEF7FB;
2039
  margin: 15px 0px 10px 0px !important;
@@ -2053,6 +2057,7 @@
2053
 
2054
  #lrgawidget_realtime_activenow .lrgawidget_realtime_rn{
2055
  font-size: 200%;
 
2056
  }
2057
 
2058
  #lrgawidget_rttotal{
@@ -2081,7 +2086,7 @@
2081
  height: 10px;
2082
  margin-right:5px;
2083
  border-radius: 1px;
2084
- margin-top: 3px;
2085
  }
2086
 
2087
  .lrgawidget_realtime_dpbar {
2034
  width: 200px;
2035
  }
2036
 
2037
+ #lrgawidget_settings_tab select:disabled{
2038
+ background-image: none !important;
2039
+ }
2040
+
2041
  .lrgawidget-settings-pro {
2042
  background-color: #EEF7FB;
2043
  margin: 15px 0px 10px 0px !important;
2057
 
2058
  #lrgawidget_realtime_activenow .lrgawidget_realtime_rn{
2059
  font-size: 200%;
2060
+ margin-top: 15px;
2061
  }
2062
 
2063
  #lrgawidget_rttotal{
2086
  height: 10px;
2087
  margin-right:5px;
2088
  border-radius: 1px;
2089
+ margin-top: 5px;
2090
  }
2091
 
2092
  .lrgawidget_realtime_dpbar {
dist/js/lrgalite-main.js CHANGED
@@ -326,7 +326,6 @@ window.lrgawidget_debug;
326
 
327
  var dateRange = {};
328
  var systemTimeZone;
329
- var gaViewTimeZone;
330
  var lrsessionStorageReady = false;
331
  var setup = false;
332
  var debug = false;
@@ -400,10 +399,11 @@ function lrWidgetSettings(arr){
400
  lrgaErrorHandler(data);
401
  }
402
 
403
- if (data.setup === 1){
404
  setup = true;
405
  if ($("#lrgawidget a[data-target='#lrgawidget_settings_tab']").is(":visible")){
406
  $("#lrgawidget a[data-target='#lrgawidget_settings_tab']").tab('show');
 
407
  }else{
408
  lrgaErrorHandler(lrwidgetenLang.setuprequired);
409
  }
@@ -412,7 +412,6 @@ function lrWidgetSettings(arr){
412
  if (data.status == "done"){
413
  if (data.cached){ $("#lrgawidget_mode").attr( "class", "label label-success").html(lrwidgetenLang.cached);}
414
  if (data.system_timezone){ systemTimeZone = data.system_timezone;}
415
- if (data.gaview_timezone){ gaViewTimeZone = data.gaview_timezone;}
416
  }
417
  })
418
  .fail(function (jqXHR, textStatus, errorThrown) {
@@ -430,62 +429,58 @@ function lrWidgetSettings(arr){
430
  }
431
 
432
 
433
- var lrgaAccounts;
434
- var lrgaProfiles;
435
  var lrgaaccountID;
436
- var webPropertyID;
437
- var profileID;
438
- var webPropertyUrl;
439
  var lrgaLockSettings;
 
440
 
441
  function enableSettingsInput(mode){
442
  $("#lrgawidget-save-settings").prop('disabled',!mode);
443
- $('#lrgawidget-setProfileID input').prop('disabled', !mode);
444
- $('#lrgawidget-setProfileID select').prop('disabled', !mode);
445
- }
446
-
447
- function getProfileDetails(id){
448
- var cProfile = {};
449
- $.each(lrgaProfiles, function( index, profile ) {
450
- if (profile.id && profile.id == id){
451
- cProfile = profile;
452
- }
453
- });
454
- return cProfile;
455
  }
456
 
457
  function populateViews(){
458
  $('#lrgawidget-accounts').html("");
459
  $('#lrgawidget-properties').html("");
460
- $('#lrgawidget-profiles').html("");
 
 
 
 
 
 
 
 
461
 
462
- $.each(lrgaAccounts, function( index, account ) {
463
  if (account.id){
464
  if (!lrgaaccountID){lrgaaccountID = account.id;}
465
- $('#lrgawidget-accounts').append($("<option></option>").attr("value",account.id).text(account.name));
466
  if (account.id == lrgaaccountID){
467
- $("#lrgawidget-accname").html(account.name);
468
- if (account.webProperties){
469
- $.each(account.webProperties, function( index, webProperty ) {
470
- if (!webPropertyID){webPropertyID = webProperty.id;}
471
- $('#lrgawidget-properties').append($("<option></option>").attr("value",webProperty.id).text(webProperty.name + " - [ " + webProperty.id + " ] "));
472
- if (webProperty.id == webPropertyID){
473
- $("#lrgawidget-propname").html(webProperty.name);
474
- $("#lrgawidget-propurl").html(webProperty.websiteUrl+ " - [ " + webProperty.id + " ] ");
475
- $("#lrgawidget-propid").html(webProperty.id);
476
- webPropertyUrl = webProperty.websiteUrl;
477
- if (webProperty.profiles){
478
- $.each(webProperty.profiles, function( index, profile ) {
479
- if (!profileID){profileID = profile.id;}
480
- $('#lrgawidget-profiles').append($("<option></option>").attr("value",profile.id).text(profile.name));
481
- if (profile.id == profileID){
482
- $("#lrgawidget-vname").html(profile.name);
483
- $("#lrgawidget-vtype").html(profile.type);
484
- var cProfile = getProfileDetails(profile.id);
485
- $("#lrgawidget-vtimezone").html(cProfile.timezone);
486
- $('#lrgawidget-setProfileID input[name=profile_timezone]').val(cProfile.timezone);
487
- if (cProfile.timezone != systemTimeZone){
488
- $("#lrgawidget-tz-error-vtimezone").html(cProfile.timezone);
489
  $("#lrgawidget-tz-error-stimezone").html(systemTimeZone);
490
  $("#lrgawidget-timezone-show-error").show();
491
  }else{
@@ -504,8 +499,32 @@ function populateViews(){
504
 
505
 
506
  $('#lrgawidget-accounts').val(lrgaaccountID);
507
- $('#lrgawidget-properties').val(webPropertyID);
508
- $('#lrgawidget-profiles').val(profileID);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
510
  }
511
 
@@ -526,7 +545,7 @@ $(document).ready(function(){
526
  e.preventDefault();
527
  lrWidgetSettings($("#lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
528
  if (data.status == "done"){
529
- $('#lrga-wizard').wizard('selectedItem', {step: "lrga-profile"});
530
  }
531
  })
532
  });
@@ -535,16 +554,16 @@ $(document).ready(function(){
535
  e.preventDefault();
536
  lrWidgetSettings($("#express-lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
537
  if (data.status == "done"){
538
- $('#lrga-wizard').wizard('selectedItem', {step: "lrga-profile"});
539
  }
540
  })
541
  });
542
 
543
 
544
- $("#lrgawidget-setProfileID").submit(function(e) {
545
  e.preventDefault();
546
  enableSettingsInput(true);
547
- lrWidgetSettings($("#lrgawidget-setProfileID").serializeArray()).done(function (data, textStatus, jqXHR) {
548
  if (data.status == "done"){
549
  $("#lrgawidget a[data-target^='#lrgawidget_']:eq(0)").click();
550
  graphOptions = {};
@@ -552,46 +571,29 @@ $(document).ready(function(){
552
  })
553
  });
554
 
 
555
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
556
- if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-profile"){
557
- enableSettingsInput(false);
558
- lrWidgetSettings({action: "getProfiles"}).done(function (data, textStatus, jqXHR) {
559
- if (data.status == "done"){
560
- lrgaaccountID = data.current_selected.account_id;
561
- webPropertyID = data.current_selected.property_id;
562
- profileID = data.current_selected.profile_id;
563
- lrgaAccounts = data.all_accounts;
564
- lrgaProfiles = data.all_profiles;
565
- lrgaLockSettings = data.current_selected.lock_settings;
566
- if(lrgaLockSettings !== "on"){
567
- enableSettingsInput(true);
568
- $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", false);
569
- }else{
570
- $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", true);
571
- }
572
-
573
- populateViews();
574
- setup = false;
575
- }
576
- })
577
  }
578
  });
579
 
580
  $('#lrgawidget-accounts').on('change', function() {
581
  lrgaaccountID = this.value;
582
- webPropertyID = "";
583
- profileID = "";
584
  populateViews();
585
  });
586
 
587
  $('#lrgawidget-properties').on('change', function() {
588
- webPropertyID = this.value;
589
- profileID = "";
 
590
  populateViews();
591
  });
592
 
593
- $('#lrgawidget-profiles').on('change', function() {
594
- profileID = this.value;
595
  populateViews();
596
  });
597
 
@@ -601,6 +603,7 @@ $(document).ready(function(){
601
  });
602
 
603
  $('a[data-reload="lrgawidget_reload_tab"]').on('click', function(e) {
 
604
  e.preventDefault();
605
  reloadCurrentTab();
606
  });
@@ -652,9 +655,9 @@ function tooltipFunction(v, pieData, legendHeader){
652
  }
653
  });
654
  if (percent){
655
- tip = legendHeader+" "+v.label+" - Sessions: "+v.value+" - "+percent+" %";
656
  }else{
657
- tip = legendHeader+" "+v.label+" - Clicks: "+v.value;
658
  }
659
  return tip;
660
  }
@@ -818,7 +821,7 @@ function drawTablePie(tabName, callName, icons){
818
 
819
  lrWidgetSettings({action : callName}).done(function (data, textStatus, jqXHR) {
820
  if (data.status == "done"){
821
- var processedData = prepareData(data, icons);
822
  table.rows.add(processedData[0]);
823
  table.draw();
824
  drawDPieChart(tabName, processedData[1],"",icons['default_icon']['icon'], icons['default_icon']['color'], icons['default_icon']['type'], icons['default_icon']['hex']);
@@ -995,21 +998,29 @@ var graphOptions = {};
995
  var graphData = {};
996
 
997
  function drawMainGraphWidgets(data, selected){
 
998
  if ($('#lrgawidget_sb-main').is(":visible")){
999
  $.each(data, function( name, raw ){
1000
- var appnd = "";
1001
- var color = "";
1002
- if ((name == "percentNewSessions") || (name == "bounceRate")){ appnd = " %";}
1003
- if (name == selected ){ color = "#77b2d4";}
1004
- $("#lrgawidget_sb_"+name+" .description-header").html(raw['total']+appnd);
1005
  drawSparkline("#lrgawidget_spline_"+name, raw['data'], color);
1006
  });
 
 
 
 
 
 
 
 
1007
  }
1008
  }
1009
 
1010
  function drawMainGraph(){
1011
- lrWidgetSettings({action : "getSessions"}).done(function (data, textStatus, jqXHR) {
1012
- if (data.status == "done" && data.setup !== 1){
1013
 
1014
  if (isObject(data.graph)){
1015
  graphData = data.graph;
@@ -1018,7 +1029,7 @@ function drawMainGraph(){
1018
 
1019
  plotData = data.plotdata;
1020
  plotTotalData = data.totalsForAllResults;
1021
- if (!selectedPname){selectedPname = "sessions";}
1022
  drawGraph(plotData[selectedPname], selectedPname);
1023
  drawMainGraphWidgets(plotTotalData);
1024
  $("#lrgawidget_sb_"+selectedPname).addClass("selected");
@@ -1114,7 +1125,7 @@ var currenSelectedColorBox = "";
1114
  function showGraphOptions(){
1115
  if (typeof graphOptions.status == 'undefined'){
1116
  lrWidgetSettings({action : "getGraphData"}).done(function (data, textStatus, jqXHR) {
1117
- if (data.status == "done" && data.setup !== 1){
1118
  graphOptions = data;
1119
  populateSettings();
1120
  populateFilters();
@@ -1260,6 +1271,13 @@ function getPermissions(){
1260
 
1261
  }
1262
 
 
 
 
 
 
 
 
1263
  $(document).ready(function(){
1264
 
1265
  $("#lrgawidget_permissions_form").submit(function(e) {
@@ -1295,9 +1313,7 @@ $(document).ready(function(){
1295
 
1296
  if (this.hash == "#lrgawidget_settings_tab"){
1297
  if (!setup){
1298
- $('#lrga-wizard').wizard('selectedItem', {step: "lrga-profile"});
1299
- $("#lrga-wizard .steps li").removeClass("complete");
1300
- $("[data-lrgawidget-reset]").show();
1301
  }
1302
  }else if (this.hash == "#lrgawidget_permissions_tab"){
1303
  getPermissions();
@@ -1341,14 +1357,6 @@ $(document).ready(function(){
1341
 
1342
  });
1343
 
1344
- $("[data-lrgawidget-plot]").on('click', function (e) {
1345
- e.preventDefault();
1346
- selectedPname = $(this).data('lrgawidget-plot');
1347
- $("[data-lrgawidget-plot]").removeClass("selected");
1348
- drawGraph(plotData[selectedPname] , selectedPname);
1349
- $(this).addClass("selected");
1350
- });
1351
-
1352
  $('body').on('click', '#lrgawidget_panel_hide', function (e) {
1353
  var wstatevalue = "";
1354
  if ($(this).is(":checked")){
326
 
327
  var dateRange = {};
328
  var systemTimeZone;
 
329
  var lrsessionStorageReady = false;
330
  var setup = false;
331
  var debug = false;
399
  lrgaErrorHandler(data);
400
  }
401
 
402
+ if (data.setup){
403
  setup = true;
404
  if ($("#lrgawidget a[data-target='#lrgawidget_settings_tab']").is(":visible")){
405
  $("#lrgawidget a[data-target='#lrgawidget_settings_tab']").tab('show');
406
+ if (data.setup === 2){selectDataStream();}
407
  }else{
408
  lrgaErrorHandler(lrwidgetenLang.setuprequired);
409
  }
412
  if (data.status == "done"){
413
  if (data.cached){ $("#lrgawidget_mode").attr( "class", "label label-success").html(lrwidgetenLang.cached);}
414
  if (data.system_timezone){ systemTimeZone = data.system_timezone;}
 
415
  }
416
  })
417
  .fail(function (jqXHR, textStatus, errorThrown) {
429
  }
430
 
431
 
432
+ var lrgaAccountSummaries;
 
433
  var lrgaaccountID;
434
+ var propertyID;
435
+ var dataStreamID;
436
+ var propertyUrl;
437
  var lrgaLockSettings;
438
+ var lrgaForceRefresh;
439
 
440
  function enableSettingsInput(mode){
441
  $("#lrgawidget-save-settings").prop('disabled',!mode);
442
+ $('#lrgawidget-setMeasurementID input').prop('disabled', !mode);
443
+ $('#lrgawidget-setMeasurementID select').prop('disabled', !mode);
 
 
 
 
 
 
 
 
 
 
444
  }
445
 
446
  function populateViews(){
447
  $('#lrgawidget-accounts').html("");
448
  $('#lrgawidget-properties').html("");
449
+ $('#lrgawidget-dataStream').html("");
450
+ $("#lrgawidget-accname").html("");
451
+ $("#lrgawidget-propname").html("");
452
+ $("#lrgawidget-dsrl").html("");
453
+ $("#lrgawidget-dsname").html("");
454
+ $("#lrgawidget-dstype").html("");
455
+ $("#lrgawidget-ptimezone").html("");
456
+ $("#lrgawidget-timezone-show-error").hide();
457
+ $("#lrgawidget-timezone-error").hide();
458
 
459
+ $.each(lrgaAccountSummaries, function( index, account ) {
460
  if (account.id){
461
  if (!lrgaaccountID){lrgaaccountID = account.id;}
462
+ $('#lrgawidget-accounts').append($("<option></option>").attr("value",account.id).text(account.displayName));
463
  if (account.id == lrgaaccountID){
464
+ $("#lrgawidget-accname").html(account.displayName);
465
+ $('#lrgawidget-properties').append($("<option></option>").attr("value","").text("-- "+lrwidgetenLang.selectproperty+" --"));
466
+ if (account.properties){
467
+ $.each(account.properties, function( index, property ) {
468
+ $('#lrgawidget-properties').append($("<option></option>").attr("value",property.id).text(property.displayName));
469
+ if (property.id == propertyID){
470
+ $("#lrgawidget-propname").html(property.displayName);
471
+ $("#lrgawidget-propid").html(property.id);
472
+ propertyUrl = property.websiteUrl;
473
+ if (property.dataStreams){
474
+ $.each(property.dataStreams, function( index, dataStream ) {
475
+ if (!dataStreamID){dataStreamID = dataStream.id;}
476
+ $('#lrgawidget-dataStream').append($("<option></option>").attr("value",dataStream.id).text(dataStream.displayName + " - [ " + dataStream.measurementId + " ]"));
477
+ if (dataStream.id == dataStreamID){
478
+ $("#lrgawidget-dsrl").html(dataStream.defaultUri+ " - <b>[ " + dataStream.measurementId + " ]</b> ");
479
+ $("#lrgawidget-dsname").html(dataStream.displayName);
480
+ $("#lrgawidget-dstype").html(dataStream.type);
481
+ $("#lrgawidget-ptimezone").html(property.timeZone);
482
+ if (property.timeZone != systemTimeZone){
483
+ $("#lrgawidget-tz-error-vtimezone").html(property.timeZone);
 
 
484
  $("#lrgawidget-tz-error-stimezone").html(systemTimeZone);
485
  $("#lrgawidget-timezone-show-error").show();
486
  }else{
499
 
500
 
501
  $('#lrgawidget-accounts').val(lrgaaccountID);
502
+ $('#lrgawidget-properties').val(propertyID);
503
+ $('#lrgawidget-dataStream').val(dataStreamID);
504
+
505
+ }
506
+
507
+ function getAccountSummaries(pid){
508
+ enableSettingsInput(false);
509
+ lrWidgetSettings({action: "getAccountSummaries", pid: pid, purge: lrgaForceRefresh }).done(function (data, textStatus, jqXHR) {
510
+ if (data.status == "done"){
511
+ lrgaaccountID = data.current_selected.account_id;
512
+ propertyID = data.current_selected.property_id;
513
+ dataStreamID = data.current_selected.datastream_id;
514
+ lrgaAccountSummaries = data.accountSummaries;
515
+ lrgaLockSettings = data.current_selected.lock_settings;
516
+ if(lrgaLockSettings !== "on"){
517
+ enableSettingsInput(true);
518
+ $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", false);
519
+ }else{
520
+ $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", true);
521
+ }
522
+
523
+ populateViews();
524
+ lrgaForceRefresh = false;
525
+ setup = false;
526
+ }
527
+ })
528
 
529
  }
530
 
545
  e.preventDefault();
546
  lrWidgetSettings($("#lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
547
  if (data.status == "done"){
548
+ $('#lrga-wizard').wizard('selectedItem', {step: "lrga-datastream"});
549
  }
550
  })
551
  });
554
  e.preventDefault();
555
  lrWidgetSettings($("#express-lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
556
  if (data.status == "done"){
557
+ $('#lrga-wizard').wizard('selectedItem', {step: "lrga-datastream"});
558
  }
559
  })
560
  });
561
 
562
 
563
+ $("#lrgawidget-setMeasurementID").submit(function(e) {
564
  e.preventDefault();
565
  enableSettingsInput(true);
566
+ lrWidgetSettings($("#lrgawidget-setMeasurementID").serializeArray()).done(function (data, textStatus, jqXHR) {
567
  if (data.status == "done"){
568
  $("#lrgawidget a[data-target^='#lrgawidget_']:eq(0)").click();
569
  graphOptions = {};
571
  })
572
  });
573
 
574
+
575
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
576
+ if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-datastream"){
577
+ getAccountSummaries();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
578
  }
579
  });
580
 
581
  $('#lrgawidget-accounts').on('change', function() {
582
  lrgaaccountID = this.value;
583
+ propertyID = "";
584
+ dataStreamID = "";
585
  populateViews();
586
  });
587
 
588
  $('#lrgawidget-properties').on('change', function() {
589
+ getAccountSummaries(this.value);
590
+ propertyID = this.value;
591
+ dataStreamID = "";
592
  populateViews();
593
  });
594
 
595
+ $('#lrgawidget-dataStream').on('change', function() {
596
+ dataStreamID = this.value;
597
  populateViews();
598
  });
599
 
603
  });
604
 
605
  $('a[data-reload="lrgawidget_reload_tab"]').on('click', function(e) {
606
+ lrgaForceRefresh = true;
607
  e.preventDefault();
608
  reloadCurrentTab();
609
  });
655
  }
656
  });
657
  if (percent){
658
+ tip = v.label+" : "+percent+" %";
659
  }else{
660
+ tip = v.label+" : "+v.value;
661
  }
662
  return tip;
663
  }
821
 
822
  lrWidgetSettings({action : callName}).done(function (data, textStatus, jqXHR) {
823
  if (data.status == "done"){
824
+ var processedData = prepareData(data.table_data, icons);
825
  table.rows.add(processedData[0]);
826
  table.draw();
827
  drawDPieChart(tabName, processedData[1],"",icons['default_icon']['icon'], icons['default_icon']['color'], icons['default_icon']['type'], icons['default_icon']['hex']);
998
  var graphData = {};
999
 
1000
  function drawMainGraphWidgets(data, selected){
1001
+ $('#lrgawidget_sb-main .row').html("");
1002
  if ($('#lrgawidget_sb-main').is(":visible")){
1003
  $.each(data, function( name, raw ){
1004
+ var color = "";
1005
+ var minGraph = '<div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_'+name+'" data-lrgawidget-plot="'+name+'"> <div class="description-block border-right"> <span class="description-text">'+raw['label']+'</span> <h5 class="description-header">'+raw['total']+'</h5> <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_'+name+'"></div> </div> </div>';
1006
+ $('#lrgawidget_sb-main .row').append(minGraph);
1007
+ if (name == selected ){ color = "#77b2d4";}
 
1008
  drawSparkline("#lrgawidget_spline_"+name, raw['data'], color);
1009
  });
1010
+
1011
+ $("[data-lrgawidget-plot]").off('click').on('click', function (e) {
1012
+ e.preventDefault();
1013
+ selectedPname = $(this).data('lrgawidget-plot');
1014
+ $("[data-lrgawidget-plot]").removeClass("selected");
1015
+ drawGraph(plotData[selectedPname] , selectedPname);
1016
+ $(this).addClass("selected");
1017
+ });
1018
  }
1019
  }
1020
 
1021
  function drawMainGraph(){
1022
+ lrWidgetSettings({action : "getMainGraph"}).done(function (data, textStatus, jqXHR) {
1023
+ if (data.status == "done" && !setup){
1024
 
1025
  if (isObject(data.graph)){
1026
  graphData = data.graph;
1029
 
1030
  plotData = data.plotdata;
1031
  plotTotalData = data.totalsForAllResults;
1032
+ if (!selectedPname){selectedPname = "activeUsers";}
1033
  drawGraph(plotData[selectedPname], selectedPname);
1034
  drawMainGraphWidgets(plotTotalData);
1035
  $("#lrgawidget_sb_"+selectedPname).addClass("selected");
1125
  function showGraphOptions(){
1126
  if (typeof graphOptions.status == 'undefined'){
1127
  lrWidgetSettings({action : "getGraphData"}).done(function (data, textStatus, jqXHR) {
1128
+ if (data.status == "done" && !setup){
1129
  graphOptions = data;
1130
  populateSettings();
1131
  populateFilters();
1271
 
1272
  }
1273
 
1274
+ function selectDataStream(){
1275
+ $('#lrga-wizard').wizard('selectedItem', {step: "lrga-datastream"});
1276
+ $("#lrga-wizard .steps li").removeClass("complete");
1277
+ $("[data-lrgawidget-reset]").show();
1278
+
1279
+ }
1280
+
1281
  $(document).ready(function(){
1282
 
1283
  $("#lrgawidget_permissions_form").submit(function(e) {
1313
 
1314
  if (this.hash == "#lrgawidget_settings_tab"){
1315
  if (!setup){
1316
+ selectDataStream();
 
 
1317
  }
1318
  }else if (this.hash == "#lrgawidget_permissions_tab"){
1319
  getPermissions();
1357
 
1358
  });
1359
 
 
 
 
 
 
 
 
 
1360
  $('body').on('click', '#lrgawidget_panel_hide', function (e) {
1361
  var wstatevalue = "";
1362
  if ($(this).is(":checked")){
dist/js/lrgawidget.js CHANGED
@@ -28,7 +28,6 @@ window.lrgawidget_debug;
28
 
29
  var dateRange = {};
30
  var systemTimeZone;
31
- var gaViewTimeZone;
32
  var lrsessionStorageReady = false;
33
  var setup = false;
34
  var debug = false;
@@ -102,10 +101,11 @@ function lrWidgetSettings(arr){
102
  lrgaErrorHandler(data);
103
  }
104
 
105
- if (data.setup === 1){
106
  setup = true;
107
  if ($("#lrgawidget a[data-target='#lrgawidget_settings_tab']").is(":visible")){
108
  $("#lrgawidget a[data-target='#lrgawidget_settings_tab']").tab('show');
 
109
  }else{
110
  lrgaErrorHandler(lrwidgetenLang.setuprequired);
111
  }
@@ -114,7 +114,6 @@ function lrWidgetSettings(arr){
114
  if (data.status == "done"){
115
  if (data.cached){ $("#lrgawidget_mode").attr( "class", "label label-success").html(lrwidgetenLang.cached);}
116
  if (data.system_timezone){ systemTimeZone = data.system_timezone;}
117
- if (data.gaview_timezone){ gaViewTimeZone = data.gaview_timezone;}
118
  }
119
  })
120
  .fail(function (jqXHR, textStatus, errorThrown) {
@@ -132,62 +131,58 @@ function lrWidgetSettings(arr){
132
  }
133
 
134
 
135
- var lrgaAccounts;
136
- var lrgaProfiles;
137
  var lrgaaccountID;
138
- var webPropertyID;
139
- var profileID;
140
- var webPropertyUrl;
141
  var lrgaLockSettings;
 
142
 
143
  function enableSettingsInput(mode){
144
  $("#lrgawidget-save-settings").prop('disabled',!mode);
145
- $('#lrgawidget-setProfileID input').prop('disabled', !mode);
146
- $('#lrgawidget-setProfileID select').prop('disabled', !mode);
147
- }
148
-
149
- function getProfileDetails(id){
150
- var cProfile = {};
151
- $.each(lrgaProfiles, function( index, profile ) {
152
- if (profile.id && profile.id == id){
153
- cProfile = profile;
154
- }
155
- });
156
- return cProfile;
157
  }
158
 
159
  function populateViews(){
160
  $('#lrgawidget-accounts').html("");
161
  $('#lrgawidget-properties').html("");
162
- $('#lrgawidget-profiles').html("");
 
 
 
 
 
 
 
 
163
 
164
- $.each(lrgaAccounts, function( index, account ) {
165
  if (account.id){
166
  if (!lrgaaccountID){lrgaaccountID = account.id;}
167
- $('#lrgawidget-accounts').append($("<option></option>").attr("value",account.id).text(account.name));
168
  if (account.id == lrgaaccountID){
169
- $("#lrgawidget-accname").html(account.name);
170
- if (account.webProperties){
171
- $.each(account.webProperties, function( index, webProperty ) {
172
- if (!webPropertyID){webPropertyID = webProperty.id;}
173
- $('#lrgawidget-properties').append($("<option></option>").attr("value",webProperty.id).text(webProperty.name + " - [ " + webProperty.id + " ] "));
174
- if (webProperty.id == webPropertyID){
175
- $("#lrgawidget-propname").html(webProperty.name);
176
- $("#lrgawidget-propurl").html(webProperty.websiteUrl+ " - [ " + webProperty.id + " ] ");
177
- $("#lrgawidget-propid").html(webProperty.id);
178
- webPropertyUrl = webProperty.websiteUrl;
179
- if (webProperty.profiles){
180
- $.each(webProperty.profiles, function( index, profile ) {
181
- if (!profileID){profileID = profile.id;}
182
- $('#lrgawidget-profiles').append($("<option></option>").attr("value",profile.id).text(profile.name));
183
- if (profile.id == profileID){
184
- $("#lrgawidget-vname").html(profile.name);
185
- $("#lrgawidget-vtype").html(profile.type);
186
- var cProfile = getProfileDetails(profile.id);
187
- $("#lrgawidget-vtimezone").html(cProfile.timezone);
188
- $('#lrgawidget-setProfileID input[name=profile_timezone]').val(cProfile.timezone);
189
- if (cProfile.timezone != systemTimeZone){
190
- $("#lrgawidget-tz-error-vtimezone").html(cProfile.timezone);
191
  $("#lrgawidget-tz-error-stimezone").html(systemTimeZone);
192
  $("#lrgawidget-timezone-show-error").show();
193
  }else{
@@ -206,8 +201,32 @@ function populateViews(){
206
 
207
 
208
  $('#lrgawidget-accounts').val(lrgaaccountID);
209
- $('#lrgawidget-properties').val(webPropertyID);
210
- $('#lrgawidget-profiles').val(profileID);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
  }
213
 
@@ -228,7 +247,7 @@ $(document).ready(function(){
228
  e.preventDefault();
229
  lrWidgetSettings($("#lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
230
  if (data.status == "done"){
231
- $('#lrga-wizard').wizard('selectedItem', {step: "lrga-profile"});
232
  }
233
  })
234
  });
@@ -237,16 +256,16 @@ $(document).ready(function(){
237
  e.preventDefault();
238
  lrWidgetSettings($("#express-lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
239
  if (data.status == "done"){
240
- $('#lrga-wizard').wizard('selectedItem', {step: "lrga-profile"});
241
  }
242
  })
243
  });
244
 
245
 
246
- $("#lrgawidget-setProfileID").submit(function(e) {
247
  e.preventDefault();
248
  enableSettingsInput(true);
249
- lrWidgetSettings($("#lrgawidget-setProfileID").serializeArray()).done(function (data, textStatus, jqXHR) {
250
  if (data.status == "done"){
251
  $("#lrgawidget a[data-target^='#lrgawidget_']:eq(0)").click();
252
  graphOptions = {};
@@ -254,46 +273,29 @@ $(document).ready(function(){
254
  })
255
  });
256
 
 
257
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
258
- if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-profile"){
259
- enableSettingsInput(false);
260
- lrWidgetSettings({action: "getProfiles"}).done(function (data, textStatus, jqXHR) {
261
- if (data.status == "done"){
262
- lrgaaccountID = data.current_selected.account_id;
263
- webPropertyID = data.current_selected.property_id;
264
- profileID = data.current_selected.profile_id;
265
- lrgaAccounts = data.all_accounts;
266
- lrgaProfiles = data.all_profiles;
267
- lrgaLockSettings = data.current_selected.lock_settings;
268
- if(lrgaLockSettings !== "on"){
269
- enableSettingsInput(true);
270
- $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", false);
271
- }else{
272
- $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", true);
273
- }
274
-
275
- populateViews();
276
- setup = false;
277
- }
278
- })
279
  }
280
  });
281
 
282
  $('#lrgawidget-accounts').on('change', function() {
283
  lrgaaccountID = this.value;
284
- webPropertyID = "";
285
- profileID = "";
286
  populateViews();
287
  });
288
 
289
  $('#lrgawidget-properties').on('change', function() {
290
- webPropertyID = this.value;
291
- profileID = "";
 
292
  populateViews();
293
  });
294
 
295
- $('#lrgawidget-profiles').on('change', function() {
296
- profileID = this.value;
297
  populateViews();
298
  });
299
 
@@ -303,6 +305,7 @@ $(document).ready(function(){
303
  });
304
 
305
  $('a[data-reload="lrgawidget_reload_tab"]').on('click', function(e) {
 
306
  e.preventDefault();
307
  reloadCurrentTab();
308
  });
@@ -354,9 +357,9 @@ function tooltipFunction(v, pieData, legendHeader){
354
  }
355
  });
356
  if (percent){
357
- tip = legendHeader+" "+v.label+" - Sessions: "+v.value+" - "+percent+" %";
358
  }else{
359
- tip = legendHeader+" "+v.label+" - Clicks: "+v.value;
360
  }
361
  return tip;
362
  }
@@ -520,7 +523,7 @@ function drawTablePie(tabName, callName, icons){
520
 
521
  lrWidgetSettings({action : callName}).done(function (data, textStatus, jqXHR) {
522
  if (data.status == "done"){
523
- var processedData = prepareData(data, icons);
524
  table.rows.add(processedData[0]);
525
  table.draw();
526
  drawDPieChart(tabName, processedData[1],"",icons['default_icon']['icon'], icons['default_icon']['color'], icons['default_icon']['type'], icons['default_icon']['hex']);
@@ -697,21 +700,29 @@ var graphOptions = {};
697
  var graphData = {};
698
 
699
  function drawMainGraphWidgets(data, selected){
 
700
  if ($('#lrgawidget_sb-main').is(":visible")){
701
  $.each(data, function( name, raw ){
702
- var appnd = "";
703
- var color = "";
704
- if ((name == "percentNewSessions") || (name == "bounceRate")){ appnd = " %";}
705
- if (name == selected ){ color = "#77b2d4";}
706
- $("#lrgawidget_sb_"+name+" .description-header").html(raw['total']+appnd);
707
  drawSparkline("#lrgawidget_spline_"+name, raw['data'], color);
708
  });
 
 
 
 
 
 
 
 
709
  }
710
  }
711
 
712
  function drawMainGraph(){
713
- lrWidgetSettings({action : "getSessions"}).done(function (data, textStatus, jqXHR) {
714
- if (data.status == "done" && data.setup !== 1){
715
 
716
  if (isObject(data.graph)){
717
  graphData = data.graph;
@@ -720,7 +731,7 @@ function drawMainGraph(){
720
 
721
  plotData = data.plotdata;
722
  plotTotalData = data.totalsForAllResults;
723
- if (!selectedPname){selectedPname = "sessions";}
724
  drawGraph(plotData[selectedPname], selectedPname);
725
  drawMainGraphWidgets(plotTotalData);
726
  $("#lrgawidget_sb_"+selectedPname).addClass("selected");
@@ -816,7 +827,7 @@ var currenSelectedColorBox = "";
816
  function showGraphOptions(){
817
  if (typeof graphOptions.status == 'undefined'){
818
  lrWidgetSettings({action : "getGraphData"}).done(function (data, textStatus, jqXHR) {
819
- if (data.status == "done" && data.setup !== 1){
820
  graphOptions = data;
821
  populateSettings();
822
  populateFilters();
@@ -962,6 +973,13 @@ function getPermissions(){
962
 
963
  }
964
 
 
 
 
 
 
 
 
965
  $(document).ready(function(){
966
 
967
  $("#lrgawidget_permissions_form").submit(function(e) {
@@ -997,9 +1015,7 @@ $(document).ready(function(){
997
 
998
  if (this.hash == "#lrgawidget_settings_tab"){
999
  if (!setup){
1000
- $('#lrga-wizard').wizard('selectedItem', {step: "lrga-profile"});
1001
- $("#lrga-wizard .steps li").removeClass("complete");
1002
- $("[data-lrgawidget-reset]").show();
1003
  }
1004
  }else if (this.hash == "#lrgawidget_permissions_tab"){
1005
  getPermissions();
@@ -1043,14 +1059,6 @@ $(document).ready(function(){
1043
 
1044
  });
1045
 
1046
- $("[data-lrgawidget-plot]").on('click', function (e) {
1047
- e.preventDefault();
1048
- selectedPname = $(this).data('lrgawidget-plot');
1049
- $("[data-lrgawidget-plot]").removeClass("selected");
1050
- drawGraph(plotData[selectedPname] , selectedPname);
1051
- $(this).addClass("selected");
1052
- });
1053
-
1054
  $('body').on('click', '#lrgawidget_panel_hide', function (e) {
1055
  var wstatevalue = "";
1056
  if ($(this).is(":checked")){
28
 
29
  var dateRange = {};
30
  var systemTimeZone;
 
31
  var lrsessionStorageReady = false;
32
  var setup = false;
33
  var debug = false;
101
  lrgaErrorHandler(data);
102
  }
103
 
104
+ if (data.setup){
105
  setup = true;
106
  if ($("#lrgawidget a[data-target='#lrgawidget_settings_tab']").is(":visible")){
107
  $("#lrgawidget a[data-target='#lrgawidget_settings_tab']").tab('show');
108
+ if (data.setup === 2){selectDataStream();}
109
  }else{
110
  lrgaErrorHandler(lrwidgetenLang.setuprequired);
111
  }
114
  if (data.status == "done"){
115
  if (data.cached){ $("#lrgawidget_mode").attr( "class", "label label-success").html(lrwidgetenLang.cached);}
116
  if (data.system_timezone){ systemTimeZone = data.system_timezone;}
 
117
  }
118
  })
119
  .fail(function (jqXHR, textStatus, errorThrown) {
131
  }
132
 
133
 
134
+ var lrgaAccountSummaries;
 
135
  var lrgaaccountID;
136
+ var propertyID;
137
+ var dataStreamID;
138
+ var propertyUrl;
139
  var lrgaLockSettings;
140
+ var lrgaForceRefresh;
141
 
142
  function enableSettingsInput(mode){
143
  $("#lrgawidget-save-settings").prop('disabled',!mode);
144
+ $('#lrgawidget-setMeasurementID input').prop('disabled', !mode);
145
+ $('#lrgawidget-setMeasurementID select').prop('disabled', !mode);
 
 
 
 
 
 
 
 
 
 
146
  }
147
 
148
  function populateViews(){
149
  $('#lrgawidget-accounts').html("");
150
  $('#lrgawidget-properties').html("");
151
+ $('#lrgawidget-dataStream').html("");
152
+ $("#lrgawidget-accname").html("");
153
+ $("#lrgawidget-propname").html("");
154
+ $("#lrgawidget-dsrl").html("");
155
+ $("#lrgawidget-dsname").html("");
156
+ $("#lrgawidget-dstype").html("");
157
+ $("#lrgawidget-ptimezone").html("");
158
+ $("#lrgawidget-timezone-show-error").hide();
159
+ $("#lrgawidget-timezone-error").hide();
160
 
161
+ $.each(lrgaAccountSummaries, function( index, account ) {
162
  if (account.id){
163
  if (!lrgaaccountID){lrgaaccountID = account.id;}
164
+ $('#lrgawidget-accounts').append($("<option></option>").attr("value",account.id).text(account.displayName));
165
  if (account.id == lrgaaccountID){
166
+ $("#lrgawidget-accname").html(account.displayName);
167
+ $('#lrgawidget-properties').append($("<option></option>").attr("value","").text("-- "+lrwidgetenLang.selectproperty+" --"));
168
+ if (account.properties){
169
+ $.each(account.properties, function( index, property ) {
170
+ $('#lrgawidget-properties').append($("<option></option>").attr("value",property.id).text(property.displayName));
171
+ if (property.id == propertyID){
172
+ $("#lrgawidget-propname").html(property.displayName);
173
+ $("#lrgawidget-propid").html(property.id);
174
+ propertyUrl = property.websiteUrl;
175
+ if (property.dataStreams){
176
+ $.each(property.dataStreams, function( index, dataStream ) {
177
+ if (!dataStreamID){dataStreamID = dataStream.id;}
178
+ $('#lrgawidget-dataStream').append($("<option></option>").attr("value",dataStream.id).text(dataStream.displayName + " - [ " + dataStream.measurementId + " ]"));
179
+ if (dataStream.id == dataStreamID){
180
+ $("#lrgawidget-dsrl").html(dataStream.defaultUri+ " - <b>[ " + dataStream.measurementId + " ]</b> ");
181
+ $("#lrgawidget-dsname").html(dataStream.displayName);
182
+ $("#lrgawidget-dstype").html(dataStream.type);
183
+ $("#lrgawidget-ptimezone").html(property.timeZone);
184
+ if (property.timeZone != systemTimeZone){
185
+ $("#lrgawidget-tz-error-vtimezone").html(property.timeZone);
 
 
186
  $("#lrgawidget-tz-error-stimezone").html(systemTimeZone);
187
  $("#lrgawidget-timezone-show-error").show();
188
  }else{
201
 
202
 
203
  $('#lrgawidget-accounts').val(lrgaaccountID);
204
+ $('#lrgawidget-properties').val(propertyID);
205
+ $('#lrgawidget-dataStream').val(dataStreamID);
206
+
207
+ }
208
+
209
+ function getAccountSummaries(pid){
210
+ enableSettingsInput(false);
211
+ lrWidgetSettings({action: "getAccountSummaries", pid: pid, purge: lrgaForceRefresh }).done(function (data, textStatus, jqXHR) {
212
+ if (data.status == "done"){
213
+ lrgaaccountID = data.current_selected.account_id;
214
+ propertyID = data.current_selected.property_id;
215
+ dataStreamID = data.current_selected.datastream_id;
216
+ lrgaAccountSummaries = data.accountSummaries;
217
+ lrgaLockSettings = data.current_selected.lock_settings;
218
+ if(lrgaLockSettings !== "on"){
219
+ enableSettingsInput(true);
220
+ $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", false);
221
+ }else{
222
+ $('.lrgawidget-lock-settings input[type=checkbox]').prop("checked", true);
223
+ }
224
+
225
+ populateViews();
226
+ lrgaForceRefresh = false;
227
+ setup = false;
228
+ }
229
+ })
230
 
231
  }
232
 
247
  e.preventDefault();
248
  lrWidgetSettings($("#lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
249
  if (data.status == "done"){
250
+ $('#lrga-wizard').wizard('selectedItem', {step: "lrga-datastream"});
251
  }
252
  })
253
  });
256
  e.preventDefault();
257
  lrWidgetSettings($("#express-lrgawidget-code").serializeArray()).done(function (data, textStatus, jqXHR) {
258
  if (data.status == "done"){
259
+ $('#lrga-wizard').wizard('selectedItem', {step: "lrga-datastream"});
260
  }
261
  })
262
  });
263
 
264
 
265
+ $("#lrgawidget-setMeasurementID").submit(function(e) {
266
  e.preventDefault();
267
  enableSettingsInput(true);
268
+ lrWidgetSettings($("#lrgawidget-setMeasurementID").serializeArray()).done(function (data, textStatus, jqXHR) {
269
  if (data.status == "done"){
270
  $("#lrgawidget a[data-target^='#lrgawidget_']:eq(0)").click();
271
  graphOptions = {};
273
  })
274
  });
275
 
276
+
277
  $('#lrga-wizard').on('changed.fu.wizard', function (evt, data) {
278
+ if ($("[data-step="+data.step+"]").attr("data-name") == "lrga-datastream"){
279
+ getAccountSummaries();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  }
281
  });
282
 
283
  $('#lrgawidget-accounts').on('change', function() {
284
  lrgaaccountID = this.value;
285
+ propertyID = "";
286
+ dataStreamID = "";
287
  populateViews();
288
  });
289
 
290
  $('#lrgawidget-properties').on('change', function() {
291
+ getAccountSummaries(this.value);
292
+ propertyID = this.value;
293
+ dataStreamID = "";
294
  populateViews();
295
  });
296
 
297
+ $('#lrgawidget-dataStream').on('change', function() {
298
+ dataStreamID = this.value;
299
  populateViews();
300
  });
301
 
305
  });
306
 
307
  $('a[data-reload="lrgawidget_reload_tab"]').on('click', function(e) {
308
+ lrgaForceRefresh = true;
309
  e.preventDefault();
310
  reloadCurrentTab();
311
  });
357
  }
358
  });
359
  if (percent){
360
+ tip = v.label+" : "+percent+" %";
361
  }else{
362
+ tip = v.label+" : "+v.value;
363
  }
364
  return tip;
365
  }
523
 
524
  lrWidgetSettings({action : callName}).done(function (data, textStatus, jqXHR) {
525
  if (data.status == "done"){
526
+ var processedData = prepareData(data.table_data, icons);
527
  table.rows.add(processedData[0]);
528
  table.draw();
529
  drawDPieChart(tabName, processedData[1],"",icons['default_icon']['icon'], icons['default_icon']['color'], icons['default_icon']['type'], icons['default_icon']['hex']);
700
  var graphData = {};
701
 
702
  function drawMainGraphWidgets(data, selected){
703
+ $('#lrgawidget_sb-main .row').html("");
704
  if ($('#lrgawidget_sb-main').is(":visible")){
705
  $.each(data, function( name, raw ){
706
+ var color = "";
707
+ var minGraph = '<div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_'+name+'" data-lrgawidget-plot="'+name+'"> <div class="description-block border-right"> <span class="description-text">'+raw['label']+'</span> <h5 class="description-header">'+raw['total']+'</h5> <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_'+name+'"></div> </div> </div>';
708
+ $('#lrgawidget_sb-main .row').append(minGraph);
709
+ if (name == selected ){ color = "#77b2d4";}
 
710
  drawSparkline("#lrgawidget_spline_"+name, raw['data'], color);
711
  });
712
+
713
+ $("[data-lrgawidget-plot]").off('click').on('click', function (e) {
714
+ e.preventDefault();
715
+ selectedPname = $(this).data('lrgawidget-plot');
716
+ $("[data-lrgawidget-plot]").removeClass("selected");
717
+ drawGraph(plotData[selectedPname] , selectedPname);
718
+ $(this).addClass("selected");
719
+ });
720
  }
721
  }
722
 
723
  function drawMainGraph(){
724
+ lrWidgetSettings({action : "getMainGraph"}).done(function (data, textStatus, jqXHR) {
725
+ if (data.status == "done" && !setup){
726
 
727
  if (isObject(data.graph)){
728
  graphData = data.graph;
731
 
732
  plotData = data.plotdata;
733
  plotTotalData = data.totalsForAllResults;
734
+ if (!selectedPname){selectedPname = "activeUsers";}
735
  drawGraph(plotData[selectedPname], selectedPname);
736
  drawMainGraphWidgets(plotTotalData);
737
  $("#lrgawidget_sb_"+selectedPname).addClass("selected");
827
  function showGraphOptions(){
828
  if (typeof graphOptions.status == 'undefined'){
829
  lrWidgetSettings({action : "getGraphData"}).done(function (data, textStatus, jqXHR) {
830
+ if (data.status == "done" && !setup){
831
  graphOptions = data;
832
  populateSettings();
833
  populateFilters();
973
 
974
  }
975
 
976
+ function selectDataStream(){
977
+ $('#lrga-wizard').wizard('selectedItem', {step: "lrga-datastream"});
978
+ $("#lrga-wizard .steps li").removeClass("complete");
979
+ $("[data-lrgawidget-reset]").show();
980
+
981
+ }
982
+
983
  $(document).ready(function(){
984
 
985
  $("#lrgawidget_permissions_form").submit(function(e) {
1015
 
1016
  if (this.hash == "#lrgawidget_settings_tab"){
1017
  if (!setup){
1018
+ selectDataStream();
 
 
1019
  }
1020
  }else if (this.hash == "#lrgawidget_permissions_tab"){
1021
  getPermissions();
1059
 
1060
  });
1061
 
 
 
 
 
 
 
 
 
1062
  $('body').on('click', '#lrgawidget_panel_hide', function (e) {
1063
  var wstatevalue = "";
1064
  if ($(this).is(":checked")){
languages/lara-google-analytics.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Lara Google Analytics\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2022-09-07 16:00+0000\n"
7
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: \n"
@@ -13,14 +13,10 @@ msgstr ""
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
  "X-Generator: Loco https://localise.biz/\n"
16
- "X-Loco-Version: 2.6.2; wp-6.1-alpha-54090\n"
17
  "X-Domain: lara-google-analytics"
18
 
19
- #: core/lrgawidget.class.php:93 widgets/lrgawidget.php:536
20
- msgid "% New Sessions"
21
- msgstr ""
22
-
23
- #: widgets/lrgawidget.php:1029
24
  msgid "(filtered from _MAX_ total entries)"
25
  msgstr ""
26
 
@@ -28,7 +24,7 @@ msgstr ""
28
  msgid "1"
29
  msgstr ""
30
 
31
- #: widgets/lrgawidget.php:917
32
  msgid "12 Months of Free Updates and Support"
33
  msgstr ""
34
 
@@ -40,11 +36,11 @@ msgstr ""
40
  msgid "3"
41
  msgstr ""
42
 
43
- #: widgets/lrgawidget.php:1044
44
  msgid ": activate to sort column ascending"
45
  msgstr ""
46
 
47
- #: widgets/lrgawidget.php:1045
48
  msgid ": activate to sort column descending"
49
  msgstr ""
50
 
@@ -56,7 +52,7 @@ msgstr ""
56
  msgid "<b>Mac/Apple:</b> Apple + R <u>or</u> Command + R"
57
  msgstr ""
58
 
59
- #: widgets/lrgawidget.php:719
60
  msgid ""
61
  "<b>Position</b> is the average ranking of your website URLs for that query "
62
  "or keyword, on Google search results."
@@ -66,7 +62,7 @@ msgstr ""
66
  msgid "<b>Windows:</b> Ctrl + F5 <u>or</u> SHIFT + Reload for firefox"
67
  msgstr ""
68
 
69
- #: widgets/lrgawidget.php:958
70
  msgid ""
71
  "<b>XtraOrbit</b> has been providing a wide range of services <b>since "
72
  "2002</b>, including <b>Web Hosting</b>, <b>Domain Names</b> & <b>Web "
@@ -77,28 +73,28 @@ msgstr ""
77
  msgid "Access Code"
78
  msgstr ""
79
 
80
- #: widgets/lrgawidget.php:356
81
  msgid "Account"
82
  msgstr ""
83
 
84
- #: widgets/lrgawidget.php:409
85
  msgid "Account Name"
86
  msgstr ""
87
 
88
- #: widgets/lrgawidget.php:582
89
  msgid "Active Page"
90
  msgstr ""
91
 
92
- #: widgets/lrgawidget.php:582
 
 
 
 
93
  msgid "Active Users"
94
  msgstr ""
95
 
96
- #: widgets/lrgawidget.php:572
97
- msgid "active users on site"
98
- msgstr ""
99
-
100
- #: widgets/lrgawidget.php:388
101
- msgid "Add <b>Google Universal Analytics</b> tracking code to all pages."
102
  msgstr ""
103
 
104
  #: core/lrgawidget.permissions.php:29
@@ -109,10 +105,10 @@ msgstr ""
109
  msgid "Advanced Setup"
110
  msgstr ""
111
 
112
- #: widgets/lrgawidget.php:444
113
  msgid ""
114
  "After adding your website to <b>Google Search Console</b> and verifying "
115
- "ownership, clich <b>Reload</b>, to reload the <b>Search Console Property "
116
  "URL</b> menu."
117
  msgstr ""
118
 
@@ -121,20 +117,20 @@ msgstr ""
121
  msgid "All Orders"
122
  msgstr ""
123
 
124
- #: widgets/lrgawidget.php:1048
125
  msgid ""
126
  "All saved authentication data will be removed. Do you want to continue ?!"
127
  msgstr ""
128
 
129
- #: widgets/lrgawidget.php:1065
130
  msgid "Apply"
131
  msgstr ""
132
 
133
- #: widgets/lrgawidget.php:1084
134
  msgid "April"
135
  msgstr ""
136
 
137
- #: widgets/lrgawidget.php:1088
138
  msgid "August"
139
  msgstr ""
140
 
@@ -146,8 +142,8 @@ msgstr ""
146
  msgid "Authorize App"
147
  msgstr ""
148
 
149
- #: core/lrgawidget.class.php:95 widgets/lrgawidget.php:522
150
- msgid "Avg. Session Duration"
151
  msgstr ""
152
 
153
  #: widgets/lrgawidget.php:336
@@ -161,11 +157,11 @@ msgstr ""
161
  msgid "beta"
162
  msgstr ""
163
 
164
- #: core/lrgawidget.class.php:94 widgets/lrgawidget.php:529
165
  msgid "Bounce Rate"
166
  msgstr ""
167
 
168
- #: widgets/lrgawidget.php:616
169
  msgid "Browser"
170
  msgstr ""
171
 
@@ -173,15 +169,11 @@ msgstr ""
173
  msgid "Browsers"
174
  msgstr ""
175
 
176
- #: widgets/lrgawidget.php:901
177
- msgid "Browsers versions (IE 6, IE 7 .. etc.)."
178
- msgstr ""
179
-
180
- #: widgets/lrgawidget.php:937
181
  msgid "Buy Now"
182
  msgstr ""
183
 
184
- #: widgets/lrgawidget.php:875
185
  msgid "Buy the Premium version and get access to these amazing features"
186
  msgstr ""
187
 
@@ -192,11 +184,11 @@ msgid ""
192
  "Application."
193
  msgstr ""
194
 
195
- #: widgets/lrgawidget.php:1056
196
  msgid "cached"
197
  msgstr ""
198
 
199
- #: widgets/lrgawidget.php:1066
200
  msgid "Cancel"
201
  msgstr ""
202
 
@@ -204,8 +196,8 @@ msgstr ""
204
  msgid "Cancelled"
205
  msgstr ""
206
 
207
- #: widgets/lrgawidget.php:428
208
- msgid "Cannot find your Google Analytics property ?"
209
  msgstr ""
210
 
211
  #: core/plugins/earnings/wordpress/lrga_wp_woo_plugin.php:65
@@ -216,11 +208,11 @@ msgstr ""
216
  msgid "Change Date Range"
217
  msgstr ""
218
 
219
- #: widgets/lrgawidget.php:911
220
  msgid "Check any Date Range, not just the last 30 days"
221
  msgstr ""
222
 
223
- #: widgets/lrgawidget.php:924
224
  msgid ""
225
  "Check the<strong> Demo</strong> to see exactly how the premium version looks "
226
  "like, and what you will get from it without leaving your wordpress dashboard"
@@ -251,7 +243,7 @@ msgid ""
251
  "open, asking you to allow the <b>app you just created</b> to :"
252
  msgstr ""
253
 
254
- #: widgets/lrgawidget.php:713
255
  msgid "Clicks"
256
  msgstr ""
257
 
@@ -267,7 +259,7 @@ msgstr ""
267
  msgid "Close"
268
  msgstr ""
269
 
270
- #: widgets/lrgawidget.php:961
271
  msgid "Come, check us out!"
272
  msgstr ""
273
 
@@ -289,7 +281,7 @@ msgstr ""
289
  msgid "Countries"
290
  msgstr ""
291
 
292
- #: widgets/lrgawidget.php:597
293
  msgid "Country"
294
  msgstr ""
295
 
@@ -301,21 +293,37 @@ msgstr ""
301
  msgid "Created"
302
  msgstr ""
303
 
304
- #: widgets/lrgawidget.php:713
305
  msgid "CTR"
306
  msgstr ""
307
 
308
- #: core/callURL.class.php:89
309
  msgid ""
310
  "cURL is not installed/enabled on your server. Please contact your server "
311
  "administrator or hosting provider for assistance with installing/enabling "
312
  "cURL extension for PHP."
313
  msgstr ""
314
 
315
- #: widgets/lrgawidget.php:1069
316
  msgid "Custom Range"
317
  msgstr ""
318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
319
  #: core/system/wordpress/system.bootstrap.class.php:67
320
  #: core/system/wordpress/system.bootstrap.class.php:81
321
  #: core/system/wordpress/system.bootstrap.class.php:84
@@ -323,15 +331,15 @@ msgstr ""
323
  msgid "DataBase Error .. please contact an administrator"
324
  msgstr ""
325
 
326
- #: widgets/lrgawidget.php:1092
327
  msgid "December"
328
  msgstr ""
329
 
330
- #: widgets/lrgawidget.php:675
331
  msgid "Device Type"
332
  msgstr ""
333
 
334
- #: widgets/lrgawidget.php:903
335
  msgid "Device Types and brands (Samsung, Apple .. etc.)."
336
  msgstr ""
337
 
@@ -347,7 +355,7 @@ msgstr ""
347
  msgid "eCommerce Graphs"
348
  msgstr ""
349
 
350
- #: widgets/lrgawidget.php:887
351
  msgid ""
352
  "eCommerce graphs : </b>Highly customized earnings graphs, for popular "
353
  "WordPress eCommerce plugins, like WooCommerce."
@@ -361,10 +369,14 @@ msgstr ""
361
  msgid "Empty Series"
362
  msgstr ""
363
 
364
- #: widgets/lrgawidget.php:392
365
  msgid "Enable eCommerce graphs."
366
  msgstr ""
367
 
 
 
 
 
368
  #: widgets/lrgawidget.php:206
369
  msgid "Express Setup"
370
  msgstr ""
@@ -373,7 +385,7 @@ msgstr ""
373
  msgid "Failed"
374
  msgstr ""
375
 
376
- #: core/callURL.class.php:89 core/lrgawidget.class.php:469
377
  #: core/lrgawidget.handler.php:23 core/lrgawidget.handler.php:28
378
  #: core/lrgawidget.handler.php:38 core/lrgawidget.handler.php:103
379
  #: core/lrgawidget.handler.php:106 core/lrgawidget.permissions.php:106
@@ -385,19 +397,19 @@ msgstr ""
385
  msgid "Fatal Error"
386
  msgstr ""
387
 
388
- #: widgets/lrgawidget.php:1082
389
  msgid "February"
390
  msgstr ""
391
 
392
- #: widgets/lrgawidget.php:1038
393
  msgid "First"
394
  msgstr ""
395
 
396
- #: widgets/lrgawidget.php:1077
397
  msgid "Fr"
398
  msgstr ""
399
 
400
- #: widgets/lrgawidget.php:1067
401
  msgid "From"
402
  msgstr ""
403
 
@@ -410,20 +422,20 @@ msgstr ""
410
  #: widgets/lrgawidget.php:293
411
  msgid ""
412
  "From the top <b>Search for APIs and Services</b> box, search for <b>Google "
413
- "Analytics API</b>, select it, then click <b>ENABLE</b>."
414
  msgstr ""
415
 
416
  #. Description of the plugin
417
  msgid ""
418
  "Full width Google Analytics dashboard widget for Wordpress admin interface, "
419
- "which also inserts latest Google Analytics tracking code to your pages."
420
  msgstr ""
421
 
422
  #: widgets/lrgawidget.php:193
423
  msgid "Go Back to Express Setup"
424
  msgstr ""
425
 
426
- #: widgets/lrgawidget.php:150 widgets/lrgawidget.php:874
427
  msgid "Go Premium !"
428
  msgstr ""
429
 
@@ -432,16 +444,26 @@ msgstr ""
432
  msgid "Google Analytics"
433
  msgstr ""
434
 
435
- #: core/GoogleAnalyticsAPI.class.php:86 core/GoogleAnalyticsAPI.class.php:98
436
  msgid ""
437
  "Google Replied with unexpected replay, enable debugging to check the reply"
438
  msgstr ""
439
 
 
 
 
 
 
 
 
 
 
 
440
  #: widgets/lrgawidget.php:75
441
  msgid "Graph Options"
442
  msgstr ""
443
 
444
- #: widgets/lrgawidget.php:981
445
  msgid "Help & Support"
446
  msgstr ""
447
 
@@ -462,11 +484,11 @@ msgstr ""
462
  msgid "I already rated it"
463
  msgstr ""
464
 
465
- #: widgets/lrgawidget.php:552 widgets/lrgawidget.php:582
466
- #: widgets/lrgawidget.php:616 widgets/lrgawidget.php:636
467
- #: widgets/lrgawidget.php:656 widgets/lrgawidget.php:675
468
- #: widgets/lrgawidget.php:694 widgets/lrgawidget.php:713
469
- #: widgets/lrgawidget.php:738
470
  msgid "ID"
471
  msgstr ""
472
 
@@ -478,7 +500,7 @@ msgid ""
478
  "it."
479
  msgstr ""
480
 
481
- #: widgets/lrgawidget.php:982
482
  msgid ""
483
  "If you are facing any issues, need support or have a new feature request, "
484
  "visit the official plugin support forum, where you will be able to submit a "
@@ -497,7 +519,7 @@ msgid ""
497
  "account should also be linked to your <b>Google Search Console</b>."
498
  msgstr ""
499
 
500
- #: widgets/lrgawidget.php:443
501
  msgid ""
502
  "If you cannot find your website, please go to <a href=\"https://www.google."
503
  "com/webmasters/tools/\" target=\"_blank\">Google Search Console</a> and "
@@ -511,7 +533,7 @@ msgid ""
511
  "reviews we get, the more cool features we will add to the plugin :)"
512
  msgstr ""
513
 
514
- #: widgets/lrgawidget.php:972
515
  msgid ""
516
  "If you have a free moment, and want to help us spread the word and boost our "
517
  "motivation, please do us a BIG favour and give us 5 Stars rating on "
@@ -519,14 +541,6 @@ msgid ""
519
  "the plugin :)"
520
  msgstr ""
521
 
522
- #: widgets/lrgawidget.php:429
523
- msgid ""
524
- "If you have recently created a new property, you might not see it here, as "
525
- "the new Google API for <b>GA4</b> properties is still in <u><a href=\"https:"
526
- "//developers.google.com/analytics/devguides/config/mgmt/v3\" "
527
- "target=\"_blank\">beta</a></u>."
528
- msgstr ""
529
-
530
  #: widgets/lrgawidget.php:253
531
  msgid ""
532
  "If you want a quick start, or just trying the widget, use the <b>Express "
@@ -539,11 +553,36 @@ msgid ""
539
  "linked to your <b>Google Analytics</b>."
540
  msgstr ""
541
 
542
- #: widgets/lrgawidget.php:713
543
  msgid "Impressions"
544
  msgstr ""
545
 
546
- #: widgets/lrgawidget.php:1058
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  msgid "inactive"
548
  msgstr ""
549
 
@@ -551,7 +590,7 @@ msgstr ""
551
  msgid "Income"
552
  msgstr ""
553
 
554
- #: widgets/lrgawidget.php:1049
555
  msgid ""
556
  "Initial Setup Required! - Please contact an administratior to complete the "
557
  "widget setup."
@@ -563,27 +602,27 @@ msgstr ""
563
  msgid "Invalid Call"
564
  msgstr ""
565
 
566
- #: core/GoogleAnalyticsAPI.class.php:132
567
  msgid "Invalid Property"
568
  msgstr ""
569
 
570
- #: core/GoogleAnalyticsAPI.class.php:86 core/GoogleAnalyticsAPI.class.php:98
571
  msgid "Invalid Reply"
572
  msgstr ""
573
 
574
- #: widgets/lrgawidget.php:1081
575
  msgid "January"
576
  msgstr ""
577
 
578
- #: widgets/lrgawidget.php:1087
579
  msgid "July"
580
  msgstr ""
581
 
582
- #: widgets/lrgawidget.php:1086
583
  msgid "June"
584
  msgstr ""
585
 
586
- #: widgets/lrgawidget.php:713
587
  msgid "Keyword"
588
  msgstr ""
589
 
@@ -591,11 +630,11 @@ msgstr ""
591
  msgid "Keywords"
592
  msgstr ""
593
 
594
- #: widgets/lrgawidget.php:893
595
  msgid "Keywords ( provided by Google Search Console)."
596
  msgstr ""
597
 
598
- #: widgets/lrgawidget.php:636
599
  msgid "Language"
600
  msgstr ""
601
 
@@ -604,30 +643,30 @@ msgid "Languages"
604
  msgstr ""
605
 
606
  #. Name of the plugin
607
- msgid "Lara's Google Analytics"
608
  msgstr ""
609
 
610
- #: widgets/lrgawidget.php:1039
611
  msgid "Last"
612
  msgstr ""
613
 
614
- #: widgets/lrgawidget.php:1053
615
  msgid "Last 30 Days"
616
  msgstr ""
617
 
618
- #: widgets/lrgawidget.php:1052
619
  msgid "Last 7 Days"
620
  msgstr ""
621
 
622
- #: widgets/lrgawidget.php:1055
623
  msgid "Last Month"
624
  msgstr ""
625
 
626
- #: widgets/lrgawidget.php:927
627
  msgid "Launch Demo"
628
  msgstr ""
629
 
630
- #: core/review.notice.php:44 widgets/lrgawidget.php:974
631
  msgid "Let's do it, You deserve it"
632
  msgstr ""
633
 
@@ -635,15 +674,15 @@ msgstr ""
635
  msgid "Loading data, please wait !"
636
  msgstr ""
637
 
638
- #: widgets/lrgawidget.php:1033
639
  msgid "Loading..."
640
  msgstr ""
641
 
642
- #: widgets/lrgawidget.php:398
643
  msgid "Lock settings"
644
  msgstr ""
645
 
646
- #: widgets/lrgawidget.php:886
647
  msgid ""
648
  "Lock Settings : </b>Prevent users from changing the widget settings or "
649
  "viewing other Google analytics profiles."
@@ -653,11 +692,11 @@ msgstr ""
653
  msgid "Make sure that your group has proper permissions to access the widget."
654
  msgstr ""
655
 
656
- #: widgets/lrgawidget.php:1083
657
  msgid "March"
658
  msgstr ""
659
 
660
- #: widgets/lrgawidget.php:1085
661
  msgid "May"
662
  msgstr ""
663
 
@@ -667,7 +706,7 @@ msgid ""
667
  "choose a valid <b>Search Console Property URL</b>."
668
  msgstr ""
669
 
670
- #: widgets/lrgawidget.php:1073
671
  msgid "Mo"
672
  msgstr ""
673
 
@@ -675,25 +714,29 @@ msgstr ""
675
  msgid "Modified"
676
  msgstr ""
677
 
678
- #: widgets/lrgawidget.php:884
679
  msgid ""
680
  "Multisite Multi-Network enabled : </b>Every blog/site in your network can "
681
  "has its own analytics tracking code and dashboard widget."
682
  msgstr ""
683
 
684
- #: widgets/lrgawidget.php:1040
 
 
 
 
685
  msgid "Next"
686
  msgstr ""
687
 
688
- #: widgets/lrgawidget.php:1060
689
  msgid "No active users"
690
  msgstr ""
691
 
692
- #: widgets/lrgawidget.php:1026
693
  msgid "No data available in table"
694
  msgstr ""
695
 
696
- #: widgets/lrgawidget.php:1051
697
  msgid ""
698
  "No data available in table. <span class='pull-left'><ul><li>Did you <a "
699
  "href='https://support.google.com/webmasters/answer/34592?hl=en' "
@@ -704,7 +747,7 @@ msgid ""
704
  "appear.</li></ul></span>"
705
  msgstr ""
706
 
707
- #: widgets/lrgawidget.php:1036
708
  msgid "No matching records found"
709
  msgstr ""
710
 
@@ -712,11 +755,11 @@ msgstr ""
712
  msgid "Not Interested"
713
  msgstr ""
714
 
715
- #: widgets/lrgawidget.php:1091
716
  msgid "November"
717
  msgstr ""
718
 
719
- #: widgets/lrgawidget.php:1090
720
  msgid "October"
721
  msgstr ""
722
 
@@ -724,6 +767,12 @@ msgstr ""
724
  msgid "On Hold"
725
  msgstr ""
726
 
 
 
 
 
 
 
727
  #: widgets/lrgawidget.php:297
728
  msgid ""
729
  "On the next screen, choose an <b>Application name</b>, then click <b>Save</b>"
@@ -743,7 +792,7 @@ msgid ""
743
  "com/apis/credentials?project=_\">Google Developers Console</a>."
744
  msgstr ""
745
 
746
- #: widgets/lrgawidget.php:656
747
  msgid "Operating System"
748
  msgstr ""
749
 
@@ -751,7 +800,7 @@ msgstr ""
751
  msgid "Operating Systems"
752
  msgstr ""
753
 
754
- #: widgets/lrgawidget.php:902
755
  msgid "Operating Systems versions (Windows 7, Windows 8 .. etc.)."
756
  msgstr ""
757
 
@@ -767,7 +816,7 @@ msgstr ""
767
  msgid "Orders"
768
  msgstr ""
769
 
770
- #: widgets/lrgawidget.php:552
771
  msgid "Page"
772
  msgstr ""
773
 
@@ -775,12 +824,7 @@ msgstr ""
775
  msgid "Pages"
776
  msgstr ""
777
 
778
- #: core/lrgawidget.class.php:96 widgets/lrgawidget.php:515
779
- msgid "Pages / Session"
780
- msgstr ""
781
-
782
- #: core/lrgawidget.class.php:92 widgets/lrgawidget.php:508
783
- #: widgets/lrgawidget.php:552
784
  msgid "Pageviews"
785
  msgstr ""
786
 
@@ -792,11 +836,11 @@ msgstr ""
792
  msgid "Pending"
793
  msgstr ""
794
 
795
- #: widgets/lrgawidget.php:552 widgets/lrgawidget.php:582
796
- #: widgets/lrgawidget.php:597 widgets/lrgawidget.php:616
797
- #: widgets/lrgawidget.php:636 widgets/lrgawidget.php:656
798
- #: widgets/lrgawidget.php:675 widgets/lrgawidget.php:694
799
- #: widgets/lrgawidget.php:738
800
  msgid "Percentage"
801
  msgstr ""
802
 
@@ -804,27 +848,27 @@ msgstr ""
804
  msgid "Permissions"
805
  msgstr ""
806
 
807
- #: widgets/lrgawidget.php:885
808
  msgid ""
809
  "Permissions : </b>Easily control which data is viwed by your blog admins and "
810
  "users (also compatible with Multisite Multi-Network)."
811
  msgstr ""
812
 
813
- #: widgets/lrgawidget.php:440
814
  msgid ""
815
  "Please choose a valid <b>Search Console Property URL</b>, or the widget will "
816
  "not be able to get keywords data for your website."
817
  msgstr ""
818
 
819
- #: widgets/lrgawidget.php:713
820
  msgid "Position"
821
  msgstr ""
822
 
823
- #: widgets/lrgawidget.php:395
824
  msgid "Premium Settings"
825
  msgstr ""
826
 
827
- #: widgets/lrgawidget.php:1041
828
  msgid "Previous"
829
  msgstr ""
830
 
@@ -832,7 +876,7 @@ msgstr ""
832
  msgid "Processing"
833
  msgstr ""
834
 
835
- #: widgets/lrgawidget.php:1034
836
  msgid "Processing..."
837
  msgstr ""
838
 
@@ -840,50 +884,54 @@ msgstr ""
840
  msgid "Products"
841
  msgstr ""
842
 
843
- #: widgets/lrgawidget.php:408
844
  msgid "Profile Details"
845
  msgstr ""
846
 
847
- #: widgets/lrgawidget.php:361
848
  msgid "Property"
849
  msgstr ""
850
 
851
- #: widgets/lrgawidget.php:410
852
  msgid "Property Name"
853
  msgstr ""
854
 
855
- #: widgets/lrgawidget.php:437
856
- msgid "Property Url"
857
  msgstr ""
858
 
859
- #: widgets/lrgawidget.php:411
860
- msgid "Property WebsiteUrl"
861
  msgstr ""
862
 
863
- #: widgets/lrgawidget.php:971
864
  msgid "Rate Us"
865
  msgstr ""
866
 
867
  #: core/lrgawidget.permissions.php:40 widgets/lrgawidget.php:123
868
- #: widgets/lrgawidget.php:1057
869
  msgid "Real Time"
870
  msgstr ""
871
 
872
- #: widgets/lrgawidget.php:894
873
  msgid "Real Time site visitors"
874
  msgstr ""
875
 
 
 
 
 
876
  #: core/plugins/earnings/wordpress/lrga_wp_woo_plugin.php:43
877
  msgid "Refunded"
878
  msgstr ""
879
 
880
- #: widgets/lrgawidget.php:446
881
  msgid "Reload"
882
  msgstr ""
883
 
884
  #: widgets/lrgawidget.php:294
885
  msgid ""
886
- "Repeat the above step to enable <b>Google Analytics Reporting API</b> and <b>"
887
  "Google Search Console API</b>."
888
  msgstr ""
889
 
@@ -891,20 +939,20 @@ msgstr ""
891
  msgid "Reset all data and start over"
892
  msgstr ""
893
 
894
- #: widgets/lrgawidget.php:570
895
- msgid "Right now"
896
- msgstr ""
897
-
898
- #: widgets/lrgawidget.php:1078
899
  msgid "Sa"
900
  msgstr ""
901
 
902
- #: widgets/lrgawidget.php:95 widgets/lrgawidget.php:402
903
- #: widgets/lrgawidget.php:473
904
  msgid "Save"
905
  msgstr ""
906
 
907
- #: widgets/lrgawidget.php:141 widgets/lrgawidget.php:694
 
 
 
 
908
  msgid "Screen Resolution"
909
  msgstr ""
910
 
@@ -912,11 +960,11 @@ msgstr ""
912
  msgid "Screen Resolutions"
913
  msgstr ""
914
 
915
- #: widgets/lrgawidget.php:436
916
  msgid "Search Console Property"
917
  msgstr ""
918
 
919
- #: widgets/lrgawidget.php:1035
920
  msgid "Search:"
921
  msgstr ""
922
 
@@ -926,23 +974,22 @@ msgid ""
926
  msgstr ""
927
 
928
  #: widgets/lrgawidget.php:183
929
- msgid "Select Analytics Profile"
930
  msgstr ""
931
 
932
- #: widgets/lrgawidget.php:1050
 
 
 
 
933
  msgid "Select Property URL"
934
  msgstr ""
935
 
936
- #: widgets/lrgawidget.php:1089
937
  msgid "September"
938
  msgstr ""
939
 
940
- #: core/lrgawidget.class.php:90 core/lrgawidget.permissions.php:39
941
- #: widgets/lrgawidget.php:117 widgets/lrgawidget.php:494
942
- #: widgets/lrgawidget.php:597 widgets/lrgawidget.php:616
943
- #: widgets/lrgawidget.php:636 widgets/lrgawidget.php:656
944
- #: widgets/lrgawidget.php:675 widgets/lrgawidget.php:694
945
- #: widgets/lrgawidget.php:738
946
  msgid "Sessions"
947
  msgstr ""
948
 
@@ -955,15 +1002,15 @@ msgstr ""
955
  msgid "Show"
956
  msgstr ""
957
 
958
- #: widgets/lrgawidget.php:1032
959
  msgid "Show _MENU_ entries"
960
  msgstr ""
961
 
962
- #: widgets/lrgawidget.php:1028
963
  msgid "Showing 0 to 0 of 0 entries"
964
  msgstr ""
965
 
966
- #: widgets/lrgawidget.php:1027
967
  msgid "Showing _START_ to _END_ of _TOTAL_ entries"
968
  msgstr ""
969
 
@@ -974,11 +1021,11 @@ msgid ""
974
  "then <u>Go to <b>Your APP Name</b></u>."
975
  msgstr ""
976
 
977
- #: core/lrgawidget.class.php:469
978
  msgid "Something went wrong .. please contact an administrator"
979
  msgstr ""
980
 
981
- #: widgets/lrgawidget.php:147 widgets/lrgawidget.php:738
982
  msgid "Source"
983
  msgstr ""
984
 
@@ -990,7 +1037,7 @@ msgstr ""
990
  msgid "Start Advanced Setup"
991
  msgstr ""
992
 
993
- #: widgets/lrgawidget.php:1072
994
  msgid "Su"
995
  msgstr ""
996
 
@@ -1003,7 +1050,7 @@ msgstr ""
1003
  msgid "Super Administrator [Change Permissions]"
1004
  msgstr ""
1005
 
1006
- #: widgets/lrgawidget.php:984
1007
  msgid "Support Center"
1008
  msgstr ""
1009
 
@@ -1017,7 +1064,7 @@ msgid ""
1017
  "."
1018
  msgstr ""
1019
 
1020
- #: widgets/lrgawidget.php:1076
1021
  msgid "Th"
1022
  msgstr ""
1023
 
@@ -1027,10 +1074,10 @@ msgid ""
1027
  "saved your valuable time and efforts!"
1028
  msgstr ""
1029
 
1030
- #: widgets/lrgawidget.php:417
1031
  msgid ""
1032
- "The selected view is using a different timezone than your server's time zone,"
1033
- " which <u>may</u> cause inaccurate dates/values."
1034
  msgstr ""
1035
 
1036
  #: widgets/lrgawidget.php:30
@@ -1041,19 +1088,15 @@ msgid ""
1041
  "the widget from loading required files."
1042
  msgstr ""
1043
 
1044
- #: widgets/lrgawidget.php:1054
1045
  msgid "This Month"
1046
  msgstr ""
1047
 
1048
- #: widgets/lrgawidget.php:431
1049
- msgid "This will allow the widget to access your newly created property."
1050
- msgstr ""
1051
-
1052
- #: widgets/lrgawidget.php:420
1053
  msgid "Time Zone"
1054
  msgstr ""
1055
 
1056
- #: widgets/lrgawidget.php:1068
1057
  msgid "To"
1058
  msgstr ""
1059
 
@@ -1061,14 +1104,7 @@ msgstr ""
1061
  msgid "To clear the cache memory of your browser :"
1062
  msgstr ""
1063
 
1064
- #: widgets/lrgawidget.php:430
1065
- msgid ""
1066
- "To overcome this limitation, when you create a <b>new</b> Google Analytics "
1067
- "property, click on <b>Show Advanced Options</b> and then click on <b>Create "
1068
- "a Universal Analytics Property</b>."
1069
- msgstr ""
1070
-
1071
- #: widgets/lrgawidget.php:398
1072
  msgid ""
1073
  "To unlock after saving, you will need to <b>reset all data</b> and re-"
1074
  "authorize with Google Analytics"
@@ -1080,11 +1116,11 @@ msgid ""
1080
  "Google App</b> as follows :"
1081
  msgstr ""
1082
 
1083
- #: widgets/lrgawidget.php:580
1084
  msgid "Top Active Pages"
1085
  msgstr ""
1086
 
1087
- #: widgets/lrgawidget.php:1059
1088
  msgid "Total"
1089
  msgstr ""
1090
 
@@ -1092,11 +1128,11 @@ msgstr ""
1092
  msgid "Totals"
1093
  msgstr ""
1094
 
1095
- #: widgets/lrgawidget.php:895
1096
  msgid "Traffic sources."
1097
  msgstr ""
1098
 
1099
- #: widgets/lrgawidget.php:1074
1100
  msgid "Tu"
1101
  msgstr ""
1102
 
@@ -1115,63 +1151,66 @@ msgid ""
1115
  "https://auth.xtraorbit.com</b>, then click <b>CREATE</b>."
1116
  msgstr ""
1117
 
1118
- #: core/lrgawidget.class.php:91 widgets/lrgawidget.php:501
1119
- msgid "Users"
1120
  msgstr ""
1121
 
1122
- #: widgets/lrgawidget.php:366
1123
- msgid "View"
1124
  msgstr ""
1125
 
1126
- #: widgets/lrgawidget.php:940
1127
  msgid "View all premuim features details"
1128
  msgstr ""
1129
 
1130
- #: widgets/lrgawidget.php:412
1131
- msgid "View Name"
1132
- msgstr ""
1133
-
1134
  #: widgets/lrgawidget.php:212 widgets/lrgawidget.php:334
1135
  msgid "View Search Console data for your verified sites"
1136
  msgstr ""
1137
 
1138
- #: widgets/lrgawidget.php:414 widgets/lrgawidget.php:419
1139
- msgid "View Time Zone"
1140
- msgstr ""
1141
-
1142
- #: widgets/lrgawidget.php:413
1143
- msgid "View Type"
1144
- msgstr ""
1145
-
1146
  #: widgets/lrgawidget.php:211 widgets/lrgawidget.php:333
1147
  msgid "View your Google Analytics data"
1148
  msgstr ""
1149
 
1150
- #: widgets/lrgawidget.php:896
 
 
 
 
1151
  msgid "Visitors Countries"
1152
  msgstr ""
1153
 
1154
- #: widgets/lrgawidget.php:1070
1155
  msgid "W"
1156
  msgstr ""
1157
 
1158
- #: widgets/lrgawidget.php:1075
1159
  msgid "We"
1160
  msgstr ""
1161
 
1162
- #: widgets/lrgawidget.php:959
1163
  msgid ""
1164
  "We mix creativity with imagination, responsibility with passion, and "
1165
  "resourcefulness with fun. That is what we do everyday within our company."
1166
  msgstr ""
1167
 
 
 
 
 
 
 
 
 
 
 
 
1168
  #: widgets/lrgawidget.php:303
1169
  msgid ""
1170
  "When done, paste the <b>client ID</b> & <b>client secret</b> here and click "
1171
  "<b>Submit</b>."
1172
  msgstr ""
1173
 
1174
- #: widgets/lrgawidget.php:957
1175
  msgid "Who we are & What we do"
1176
  msgstr ""
1177
 
@@ -1180,12 +1219,12 @@ msgstr ""
1180
  msgid "WooCommerce"
1181
  msgstr ""
1182
 
1183
- #: widgets/lrgawidget.php:395
1184
  msgid "Works in the Pro version only"
1185
  msgstr ""
1186
 
1187
  #. Author of the plugin
1188
- msgid "XtraOrbit Web development SRL"
1189
  msgstr ""
1190
 
1191
  #: core/lrgawidget.permissions.php:96
3
  msgstr ""
4
  "Project-Id-Version: Lara Google Analytics\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2022-11-15 20:05+0000\n"
7
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: \n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
  "X-Generator: Loco https://localise.biz/\n"
16
+ "X-Loco-Version: 2.6.3; wp-6.2-alpha-54840\n"
17
  "X-Domain: lara-google-analytics"
18
 
19
+ #: widgets/lrgawidget.php:995
 
 
 
 
20
  msgid "(filtered from _MAX_ total entries)"
21
  msgstr ""
22
 
24
  msgid "1"
25
  msgstr ""
26
 
27
+ #: widgets/lrgawidget.php:883
28
  msgid "12 Months of Free Updates and Support"
29
  msgstr ""
30
 
36
  msgid "3"
37
  msgstr ""
38
 
39
+ #: widgets/lrgawidget.php:1010
40
  msgid ": activate to sort column ascending"
41
  msgstr ""
42
 
43
+ #: widgets/lrgawidget.php:1011
44
  msgid ": activate to sort column descending"
45
  msgstr ""
46
 
52
  msgid "<b>Mac/Apple:</b> Apple + R <u>or</u> Command + R"
53
  msgstr ""
54
 
55
+ #: widgets/lrgawidget.php:686
56
  msgid ""
57
  "<b>Position</b> is the average ranking of your website URLs for that query "
58
  "or keyword, on Google search results."
62
  msgid "<b>Windows:</b> Ctrl + F5 <u>or</u> SHIFT + Reload for firefox"
63
  msgstr ""
64
 
65
+ #: widgets/lrgawidget.php:924
66
  msgid ""
67
  "<b>XtraOrbit</b> has been providing a wide range of services <b>since "
68
  "2002</b>, including <b>Web Hosting</b>, <b>Domain Names</b> & <b>Web "
73
  msgid "Access Code"
74
  msgstr ""
75
 
76
+ #: widgets/lrgawidget.php:355
77
  msgid "Account"
78
  msgstr ""
79
 
80
+ #: widgets/lrgawidget.php:410
81
  msgid "Account Name"
82
  msgstr ""
83
 
84
+ #: widgets/lrgawidget.php:549
85
  msgid "Active Page"
86
  msgstr ""
87
 
88
+ #: core/lrgawidget.class.php:46 widgets/lrgawidget.php:564
89
+ #: widgets/lrgawidget.php:583 widgets/lrgawidget.php:603
90
+ #: widgets/lrgawidget.php:623 widgets/lrgawidget.php:642
91
+ #: widgets/lrgawidget.php:661 widgets/lrgawidget.php:705
92
+ #: widgets/lrgawidget.php:1028
93
  msgid "Active Users"
94
  msgstr ""
95
 
96
+ #: widgets/lrgawidget.php:389
97
+ msgid "Add <b>Google Analytics GA4</b> tracking code to all pages."
 
 
 
 
98
  msgstr ""
99
 
100
  #: core/lrgawidget.permissions.php:29
105
  msgid "Advanced Setup"
106
  msgstr ""
107
 
108
+ #: widgets/lrgawidget.php:460
109
  msgid ""
110
  "After adding your website to <b>Google Search Console</b> and verifying "
111
+ "ownership, click <b>Reload</b>, to reload the <b>Search Console Property "
112
  "URL</b> menu."
113
  msgstr ""
114
 
117
  msgid "All Orders"
118
  msgstr ""
119
 
120
+ #: widgets/lrgawidget.php:1014
121
  msgid ""
122
  "All saved authentication data will be removed. Do you want to continue ?!"
123
  msgstr ""
124
 
125
+ #: widgets/lrgawidget.php:1033
126
  msgid "Apply"
127
  msgstr ""
128
 
129
+ #: widgets/lrgawidget.php:1052
130
  msgid "April"
131
  msgstr ""
132
 
133
+ #: widgets/lrgawidget.php:1056
134
  msgid "August"
135
  msgstr ""
136
 
142
  msgid "Authorize App"
143
  msgstr ""
144
 
145
+ #: core/lrgawidget.class.php:51
146
+ msgid "Average Engagement Time"
147
  msgstr ""
148
 
149
  #: widgets/lrgawidget.php:336
157
  msgid "beta"
158
  msgstr ""
159
 
160
+ #: core/lrgawidget.class.php:54
161
  msgid "Bounce Rate"
162
  msgstr ""
163
 
164
+ #: widgets/lrgawidget.php:583
165
  msgid "Browser"
166
  msgstr ""
167
 
169
  msgid "Browsers"
170
  msgstr ""
171
 
172
+ #: widgets/lrgawidget.php:903
 
 
 
 
173
  msgid "Buy Now"
174
  msgstr ""
175
 
176
+ #: widgets/lrgawidget.php:842
177
  msgid "Buy the Premium version and get access to these amazing features"
178
  msgstr ""
179
 
184
  "Application."
185
  msgstr ""
186
 
187
+ #: widgets/lrgawidget.php:1023
188
  msgid "cached"
189
  msgstr ""
190
 
191
+ #: widgets/lrgawidget.php:1034
192
  msgid "Cancel"
193
  msgstr ""
194
 
196
  msgid "Cancelled"
197
  msgstr ""
198
 
199
+ #: widgets/lrgawidget.php:429
200
+ msgid "Cannot find your Google Universal Analytics property ?"
201
  msgstr ""
202
 
203
  #: core/plugins/earnings/wordpress/lrga_wp_woo_plugin.php:65
208
  msgid "Change Date Range"
209
  msgstr ""
210
 
211
+ #: widgets/lrgawidget.php:877
212
  msgid "Check any Date Range, not just the last 30 days"
213
  msgstr ""
214
 
215
+ #: widgets/lrgawidget.php:890
216
  msgid ""
217
  "Check the<strong> Demo</strong> to see exactly how the premium version looks "
218
  "like, and what you will get from it without leaving your wordpress dashboard"
243
  "open, asking you to allow the <b>app you just created</b> to :"
244
  msgstr ""
245
 
246
+ #: widgets/lrgawidget.php:680
247
  msgid "Clicks"
248
  msgstr ""
249
 
259
  msgid "Close"
260
  msgstr ""
261
 
262
+ #: widgets/lrgawidget.php:927
263
  msgid "Come, check us out!"
264
  msgstr ""
265
 
281
  msgid "Countries"
282
  msgstr ""
283
 
284
+ #: widgets/lrgawidget.php:564
285
  msgid "Country"
286
  msgstr ""
287
 
293
  msgid "Created"
294
  msgstr ""
295
 
296
+ #: widgets/lrgawidget.php:680
297
  msgid "CTR"
298
  msgstr ""
299
 
300
+ #: core/callURL.class.php:94
301
  msgid ""
302
  "cURL is not installed/enabled on your server. Please contact your server "
303
  "administrator or hosting provider for assistance with installing/enabling "
304
  "cURL extension for PHP."
305
  msgstr ""
306
 
307
+ #: widgets/lrgawidget.php:1037
308
  msgid "Custom Range"
309
  msgstr ""
310
 
311
+ #: widgets/lrgawidget.php:365
312
+ msgid "Data Stream"
313
+ msgstr ""
314
+
315
+ #: widgets/lrgawidget.php:412
316
+ msgid "Data Stream Name"
317
+ msgstr ""
318
+
319
+ #: widgets/lrgawidget.php:414
320
+ msgid "Data Stream Type"
321
+ msgstr ""
322
+
323
+ #: widgets/lrgawidget.php:413
324
+ msgid "Data Stream Url"
325
+ msgstr ""
326
+
327
  #: core/system/wordpress/system.bootstrap.class.php:67
328
  #: core/system/wordpress/system.bootstrap.class.php:81
329
  #: core/system/wordpress/system.bootstrap.class.php:84
331
  msgid "DataBase Error .. please contact an administrator"
332
  msgstr ""
333
 
334
+ #: widgets/lrgawidget.php:1060
335
  msgid "December"
336
  msgstr ""
337
 
338
+ #: widgets/lrgawidget.php:642
339
  msgid "Device Type"
340
  msgstr ""
341
 
342
+ #: widgets/lrgawidget.php:869
343
  msgid "Device Types and brands (Samsung, Apple .. etc.)."
344
  msgstr ""
345
 
355
  msgid "eCommerce Graphs"
356
  msgstr ""
357
 
358
+ #: widgets/lrgawidget.php:854
359
  msgid ""
360
  "eCommerce graphs : </b>Highly customized earnings graphs, for popular "
361
  "WordPress eCommerce plugins, like WooCommerce."
369
  msgid "Empty Series"
370
  msgstr ""
371
 
372
+ #: widgets/lrgawidget.php:393
373
  msgid "Enable eCommerce graphs."
374
  msgstr ""
375
 
376
+ #: core/lrgawidget.class.php:50
377
+ msgid "Event Count"
378
+ msgstr ""
379
+
380
  #: widgets/lrgawidget.php:206
381
  msgid "Express Setup"
382
  msgstr ""
385
  msgid "Failed"
386
  msgstr ""
387
 
388
+ #: core/callURL.class.php:94 core/lrgawidget.class.php:626
389
  #: core/lrgawidget.handler.php:23 core/lrgawidget.handler.php:28
390
  #: core/lrgawidget.handler.php:38 core/lrgawidget.handler.php:103
391
  #: core/lrgawidget.handler.php:106 core/lrgawidget.permissions.php:106
397
  msgid "Fatal Error"
398
  msgstr ""
399
 
400
+ #: widgets/lrgawidget.php:1050
401
  msgid "February"
402
  msgstr ""
403
 
404
+ #: widgets/lrgawidget.php:1004
405
  msgid "First"
406
  msgstr ""
407
 
408
+ #: widgets/lrgawidget.php:1045
409
  msgid "Fr"
410
  msgstr ""
411
 
412
+ #: widgets/lrgawidget.php:1035
413
  msgid "From"
414
  msgstr ""
415
 
422
  #: widgets/lrgawidget.php:293
423
  msgid ""
424
  "From the top <b>Search for APIs and Services</b> box, search for <b>Google "
425
+ "Analytics Admin API</b>, select it, then click <b>ENABLE</b>."
426
  msgstr ""
427
 
428
  #. Description of the plugin
429
  msgid ""
430
  "Full width Google Analytics dashboard widget for Wordpress admin interface, "
431
+ "which also inserts latest Google Analytics (GA4) tracking code to your pages."
432
  msgstr ""
433
 
434
  #: widgets/lrgawidget.php:193
435
  msgid "Go Back to Express Setup"
436
  msgstr ""
437
 
438
+ #: widgets/lrgawidget.php:150 widgets/lrgawidget.php:841
439
  msgid "Go Premium !"
440
  msgstr ""
441
 
444
  msgid "Google Analytics"
445
  msgstr ""
446
 
447
+ #: core/GoogleAnalyticsAPI.class.php:90 core/GoogleAnalyticsAPI.class.php:102
448
  msgid ""
449
  "Google Replied with unexpected replay, enable debugging to check the reply"
450
  msgstr ""
451
 
452
+ #: widgets/lrgawidget.php:430
453
+ msgid ""
454
+ "Google will will stop processing data for Universal Analytics properties on "
455
+ "July 1, 2023, so it is time to upgrade to the new GA4 properties."
456
+ msgstr ""
457
+
458
+ #: core/lrgawidget.permissions.php:39 widgets/lrgawidget.php:117
459
+ msgid "Graph"
460
+ msgstr ""
461
+
462
  #: widgets/lrgawidget.php:75
463
  msgid "Graph Options"
464
  msgstr ""
465
 
466
+ #: widgets/lrgawidget.php:947
467
  msgid "Help & Support"
468
  msgstr ""
469
 
484
  msgid "I already rated it"
485
  msgstr ""
486
 
487
+ #: widgets/lrgawidget.php:519 widgets/lrgawidget.php:549
488
+ #: widgets/lrgawidget.php:583 widgets/lrgawidget.php:603
489
+ #: widgets/lrgawidget.php:623 widgets/lrgawidget.php:642
490
+ #: widgets/lrgawidget.php:661 widgets/lrgawidget.php:680
491
+ #: widgets/lrgawidget.php:705
492
  msgid "ID"
493
  msgstr ""
494
 
500
  "it."
501
  msgstr ""
502
 
503
+ #: widgets/lrgawidget.php:948
504
  msgid ""
505
  "If you are facing any issues, need support or have a new feature request, "
506
  "visit the official plugin support forum, where you will be able to submit a "
519
  "account should also be linked to your <b>Google Search Console</b>."
520
  msgstr ""
521
 
522
+ #: widgets/lrgawidget.php:459
523
  msgid ""
524
  "If you cannot find your website, please go to <a href=\"https://www.google."
525
  "com/webmasters/tools/\" target=\"_blank\">Google Search Console</a> and "
533
  "reviews we get, the more cool features we will add to the plugin :)"
534
  msgstr ""
535
 
536
+ #: widgets/lrgawidget.php:938
537
  msgid ""
538
  "If you have a free moment, and want to help us spread the word and boost our "
539
  "motivation, please do us a BIG favour and give us 5 Stars rating on "
541
  "the plugin :)"
542
  msgstr ""
543
 
 
 
 
 
 
 
 
 
544
  #: widgets/lrgawidget.php:253
545
  msgid ""
546
  "If you want a quick start, or just trying the widget, use the <b>Express "
553
  "linked to your <b>Google Analytics</b>."
554
  msgstr ""
555
 
556
+ #: widgets/lrgawidget.php:680
557
  msgid "Impressions"
558
  msgstr ""
559
 
560
+ #: widgets/lrgawidget.php:434
561
+ msgid ""
562
+ "In <a target=\"_blank\" href=\"//analytics.google.com/analytics/web/\"> "
563
+ "Google Analytics</a>, click <i class=\"fas fa-cog fa-fw\"></i> Admin."
564
+ msgstr ""
565
+
566
+ #: widgets/lrgawidget.php:435
567
+ msgid ""
568
+ "In the <b>Account</b> column, make sure that your desired account is "
569
+ "selected."
570
+ msgstr ""
571
+
572
+ #: widgets/lrgawidget.php:436
573
+ msgid ""
574
+ "In the <b>Property</b> column, select the Universal Analytics property that "
575
+ "currently collects data for your website."
576
+ msgstr ""
577
+
578
+ #: widgets/lrgawidget.php:437
579
+ msgid ""
580
+ "In the Property column, click <b>GA4 Setup Assistant</b>, then click <b>Get "
581
+ "Started</b> under <u>I want to create a new Google Analytics 4 property</u>, "
582
+ "then click on <b>Create and Continue</b>."
583
+ msgstr ""
584
+
585
+ #: widgets/lrgawidget.php:1025
586
  msgid "inactive"
587
  msgstr ""
588
 
590
  msgid "Income"
591
  msgstr ""
592
 
593
+ #: widgets/lrgawidget.php:1015
594
  msgid ""
595
  "Initial Setup Required! - Please contact an administratior to complete the "
596
  "widget setup."
602
  msgid "Invalid Call"
603
  msgstr ""
604
 
605
+ #: core/GoogleAnalyticsAPI.class.php:136
606
  msgid "Invalid Property"
607
  msgstr ""
608
 
609
+ #: core/GoogleAnalyticsAPI.class.php:90 core/GoogleAnalyticsAPI.class.php:102
610
  msgid "Invalid Reply"
611
  msgstr ""
612
 
613
+ #: widgets/lrgawidget.php:1049
614
  msgid "January"
615
  msgstr ""
616
 
617
+ #: widgets/lrgawidget.php:1055
618
  msgid "July"
619
  msgstr ""
620
 
621
+ #: widgets/lrgawidget.php:1054
622
  msgid "June"
623
  msgstr ""
624
 
625
+ #: widgets/lrgawidget.php:680
626
  msgid "Keyword"
627
  msgstr ""
628
 
630
  msgid "Keywords"
631
  msgstr ""
632
 
633
+ #: widgets/lrgawidget.php:860
634
  msgid "Keywords ( provided by Google Search Console)."
635
  msgstr ""
636
 
637
+ #: widgets/lrgawidget.php:603
638
  msgid "Language"
639
  msgstr ""
640
 
643
  msgstr ""
644
 
645
  #. Name of the plugin
646
+ msgid "Lara's Google Analytics (GA4)"
647
  msgstr ""
648
 
649
+ #: widgets/lrgawidget.php:1005
650
  msgid "Last"
651
  msgstr ""
652
 
653
+ #: widgets/lrgawidget.php:1020
654
  msgid "Last 30 Days"
655
  msgstr ""
656
 
657
+ #: widgets/lrgawidget.php:1019
658
  msgid "Last 7 Days"
659
  msgstr ""
660
 
661
+ #: widgets/lrgawidget.php:1022
662
  msgid "Last Month"
663
  msgstr ""
664
 
665
+ #: widgets/lrgawidget.php:893
666
  msgid "Launch Demo"
667
  msgstr ""
668
 
669
+ #: core/review.notice.php:44 widgets/lrgawidget.php:940
670
  msgid "Let's do it, You deserve it"
671
  msgstr ""
672
 
674
  msgid "Loading data, please wait !"
675
  msgstr ""
676
 
677
+ #: widgets/lrgawidget.php:999
678
  msgid "Loading..."
679
  msgstr ""
680
 
681
+ #: widgets/lrgawidget.php:399
682
  msgid "Lock settings"
683
  msgstr ""
684
 
685
+ #: widgets/lrgawidget.php:853
686
  msgid ""
687
  "Lock Settings : </b>Prevent users from changing the widget settings or "
688
  "viewing other Google analytics profiles."
692
  msgid "Make sure that your group has proper permissions to access the widget."
693
  msgstr ""
694
 
695
+ #: widgets/lrgawidget.php:1051
696
  msgid "March"
697
  msgstr ""
698
 
699
+ #: widgets/lrgawidget.php:1053
700
  msgid "May"
701
  msgstr ""
702
 
706
  "choose a valid <b>Search Console Property URL</b>."
707
  msgstr ""
708
 
709
+ #: widgets/lrgawidget.php:1041
710
  msgid "Mo"
711
  msgstr ""
712
 
714
  msgid "Modified"
715
  msgstr ""
716
 
717
+ #: widgets/lrgawidget.php:851
718
  msgid ""
719
  "Multisite Multi-Network enabled : </b>Every blog/site in your network can "
720
  "has its own analytics tracking code and dashboard widget."
721
  msgstr ""
722
 
723
+ #: core/lrgawidget.class.php:47
724
+ msgid "New Users"
725
+ msgstr ""
726
+
727
+ #: widgets/lrgawidget.php:1006
728
  msgid "Next"
729
  msgstr ""
730
 
731
+ #: widgets/lrgawidget.php:1027
732
  msgid "No active users"
733
  msgstr ""
734
 
735
+ #: widgets/lrgawidget.php:992
736
  msgid "No data available in table"
737
  msgstr ""
738
 
739
+ #: widgets/lrgawidget.php:1018
740
  msgid ""
741
  "No data available in table. <span class='pull-left'><ul><li>Did you <a "
742
  "href='https://support.google.com/webmasters/answer/34592?hl=en' "
747
  "appear.</li></ul></span>"
748
  msgstr ""
749
 
750
+ #: widgets/lrgawidget.php:1002
751
  msgid "No matching records found"
752
  msgstr ""
753
 
755
  msgid "Not Interested"
756
  msgstr ""
757
 
758
+ #: widgets/lrgawidget.php:1059
759
  msgid "November"
760
  msgstr ""
761
 
762
+ #: widgets/lrgawidget.php:1058
763
  msgid "October"
764
  msgstr ""
765
 
767
  msgid "On Hold"
768
  msgstr ""
769
 
770
+ #: widgets/lrgawidget.php:438
771
+ msgid ""
772
+ "On the <b>Set up a Google tag</b> page, select <b>Install a Google tag </b> "
773
+ "and click <b>Next</b>, then click <b>Done</b> on the next page."
774
+ msgstr ""
775
+
776
  #: widgets/lrgawidget.php:297
777
  msgid ""
778
  "On the next screen, choose an <b>Application name</b>, then click <b>Save</b>"
792
  "com/apis/credentials?project=_\">Google Developers Console</a>."
793
  msgstr ""
794
 
795
+ #: widgets/lrgawidget.php:623
796
  msgid "Operating System"
797
  msgstr ""
798
 
800
  msgid "Operating Systems"
801
  msgstr ""
802
 
803
+ #: widgets/lrgawidget.php:868
804
  msgid "Operating Systems versions (Windows 7, Windows 8 .. etc.)."
805
  msgstr ""
806
 
816
  msgid "Orders"
817
  msgstr ""
818
 
819
+ #: widgets/lrgawidget.php:519
820
  msgid "Page"
821
  msgstr ""
822
 
824
  msgid "Pages"
825
  msgstr ""
826
 
827
+ #: widgets/lrgawidget.php:519
 
 
 
 
 
828
  msgid "Pageviews"
829
  msgstr ""
830
 
836
  msgid "Pending"
837
  msgstr ""
838
 
839
+ #: widgets/lrgawidget.php:519 widgets/lrgawidget.php:549
840
+ #: widgets/lrgawidget.php:564 widgets/lrgawidget.php:583
841
+ #: widgets/lrgawidget.php:603 widgets/lrgawidget.php:623
842
+ #: widgets/lrgawidget.php:642 widgets/lrgawidget.php:661
843
+ #: widgets/lrgawidget.php:705
844
  msgid "Percentage"
845
  msgstr ""
846
 
848
  msgid "Permissions"
849
  msgstr ""
850
 
851
+ #: widgets/lrgawidget.php:852
852
  msgid ""
853
  "Permissions : </b>Easily control which data is viwed by your blog admins and "
854
  "users (also compatible with Multisite Multi-Network)."
855
  msgstr ""
856
 
857
+ #: widgets/lrgawidget.php:456
858
  msgid ""
859
  "Please choose a valid <b>Search Console Property URL</b>, or the widget will "
860
  "not be able to get keywords data for your website."
861
  msgstr ""
862
 
863
+ #: widgets/lrgawidget.php:680
864
  msgid "Position"
865
  msgstr ""
866
 
867
+ #: widgets/lrgawidget.php:396
868
  msgid "Premium Settings"
869
  msgstr ""
870
 
871
+ #: widgets/lrgawidget.php:1007
872
  msgid "Previous"
873
  msgstr ""
874
 
876
  msgid "Processing"
877
  msgstr ""
878
 
879
+ #: widgets/lrgawidget.php:1000
880
  msgid "Processing..."
881
  msgstr ""
882
 
884
  msgid "Products"
885
  msgstr ""
886
 
887
+ #: widgets/lrgawidget.php:409
888
  msgid "Profile Details"
889
  msgstr ""
890
 
891
+ #: widgets/lrgawidget.php:360
892
  msgid "Property"
893
  msgstr ""
894
 
895
+ #: widgets/lrgawidget.php:411
896
  msgid "Property Name"
897
  msgstr ""
898
 
899
+ #: widgets/lrgawidget.php:415 widgets/lrgawidget.php:420
900
+ msgid "Property Time Zone"
901
  msgstr ""
902
 
903
+ #: widgets/lrgawidget.php:453
904
+ msgid "Property Url"
905
  msgstr ""
906
 
907
+ #: widgets/lrgawidget.php:937
908
  msgid "Rate Us"
909
  msgstr ""
910
 
911
  #: core/lrgawidget.permissions.php:40 widgets/lrgawidget.php:123
912
+ #: widgets/lrgawidget.php:1024
913
  msgid "Real Time"
914
  msgstr ""
915
 
916
+ #: widgets/lrgawidget.php:861
917
  msgid "Real Time site visitors"
918
  msgstr ""
919
 
920
+ #: widgets/lrgawidget.php:537
921
+ msgid "Realtime Overview"
922
+ msgstr ""
923
+
924
  #: core/plugins/earnings/wordpress/lrga_wp_woo_plugin.php:43
925
  msgid "Refunded"
926
  msgstr ""
927
 
928
+ #: widgets/lrgawidget.php:442 widgets/lrgawidget.php:462
929
  msgid "Reload"
930
  msgstr ""
931
 
932
  #: widgets/lrgawidget.php:294
933
  msgid ""
934
+ "Repeat the above step to enable <b>Google Analytics Data API</b> and <b>"
935
  "Google Search Console API</b>."
936
  msgstr ""
937
 
939
  msgid "Reset all data and start over"
940
  msgstr ""
941
 
942
+ #: widgets/lrgawidget.php:1046
 
 
 
 
943
  msgid "Sa"
944
  msgstr ""
945
 
946
+ #: widgets/lrgawidget.php:95 widgets/lrgawidget.php:403
947
+ #: widgets/lrgawidget.php:489
948
  msgid "Save"
949
  msgstr ""
950
 
951
+ #: core/lrgawidget.class.php:49
952
+ msgid "Screen Page Views"
953
+ msgstr ""
954
+
955
+ #: widgets/lrgawidget.php:141 widgets/lrgawidget.php:661
956
  msgid "Screen Resolution"
957
  msgstr ""
958
 
960
  msgid "Screen Resolutions"
961
  msgstr ""
962
 
963
+ #: widgets/lrgawidget.php:452
964
  msgid "Search Console Property"
965
  msgstr ""
966
 
967
+ #: widgets/lrgawidget.php:1001
968
  msgid "Search:"
969
  msgstr ""
970
 
974
  msgstr ""
975
 
976
  #: widgets/lrgawidget.php:183
977
+ msgid "Select Analytics Data Stream"
978
  msgstr ""
979
 
980
+ #: widgets/lrgawidget.php:1016
981
+ msgid "Select Property"
982
+ msgstr ""
983
+
984
+ #: widgets/lrgawidget.php:1017
985
  msgid "Select Property URL"
986
  msgstr ""
987
 
988
+ #: widgets/lrgawidget.php:1057
989
  msgid "September"
990
  msgstr ""
991
 
992
+ #: core/lrgawidget.class.php:48
 
 
 
 
 
993
  msgid "Sessions"
994
  msgstr ""
995
 
1002
  msgid "Show"
1003
  msgstr ""
1004
 
1005
+ #: widgets/lrgawidget.php:998
1006
  msgid "Show _MENU_ entries"
1007
  msgstr ""
1008
 
1009
+ #: widgets/lrgawidget.php:994
1010
  msgid "Showing 0 to 0 of 0 entries"
1011
  msgstr ""
1012
 
1013
+ #: widgets/lrgawidget.php:993
1014
  msgid "Showing _START_ to _END_ of _TOTAL_ entries"
1015
  msgstr ""
1016
 
1021
  "then <u>Go to <b>Your APP Name</b></u>."
1022
  msgstr ""
1023
 
1024
+ #: core/lrgawidget.class.php:626
1025
  msgid "Something went wrong .. please contact an administrator"
1026
  msgstr ""
1027
 
1028
+ #: widgets/lrgawidget.php:147 widgets/lrgawidget.php:705
1029
  msgid "Source"
1030
  msgstr ""
1031
 
1037
  msgid "Start Advanced Setup"
1038
  msgstr ""
1039
 
1040
+ #: widgets/lrgawidget.php:1040
1041
  msgid "Su"
1042
  msgstr ""
1043
 
1050
  msgid "Super Administrator [Change Permissions]"
1051
  msgstr ""
1052
 
1053
+ #: widgets/lrgawidget.php:950
1054
  msgid "Support Center"
1055
  msgstr ""
1056
 
1064
  "."
1065
  msgstr ""
1066
 
1067
+ #: widgets/lrgawidget.php:1044
1068
  msgid "Th"
1069
  msgstr ""
1070
 
1074
  "saved your valuable time and efforts!"
1075
  msgstr ""
1076
 
1077
+ #: widgets/lrgawidget.php:418
1078
  msgid ""
1079
+ "The selected property is using a different timezone than your server's time "
1080
+ "zone, which <u>may</u> cause inaccurate dates/values."
1081
  msgstr ""
1082
 
1083
  #: widgets/lrgawidget.php:30
1088
  "the widget from loading required files."
1089
  msgstr ""
1090
 
1091
+ #: widgets/lrgawidget.php:1021
1092
  msgid "This Month"
1093
  msgstr ""
1094
 
1095
+ #: widgets/lrgawidget.php:421
 
 
 
 
1096
  msgid "Time Zone"
1097
  msgstr ""
1098
 
1099
+ #: widgets/lrgawidget.php:1036
1100
  msgid "To"
1101
  msgstr ""
1102
 
1104
  msgid "To clear the cache memory of your browser :"
1105
  msgstr ""
1106
 
1107
+ #: widgets/lrgawidget.php:399
 
 
 
 
 
 
 
1108
  msgid ""
1109
  "To unlock after saving, you will need to <b>reset all data</b> and re-"
1110
  "authorize with Google Analytics"
1116
  "Google App</b> as follows :"
1117
  msgstr ""
1118
 
1119
+ #: widgets/lrgawidget.php:547
1120
  msgid "Top Active Pages"
1121
  msgstr ""
1122
 
1123
+ #: widgets/lrgawidget.php:1026
1124
  msgid "Total"
1125
  msgstr ""
1126
 
1128
  msgid "Totals"
1129
  msgstr ""
1130
 
1131
+ #: widgets/lrgawidget.php:862
1132
  msgid "Traffic sources."
1133
  msgstr ""
1134
 
1135
+ #: widgets/lrgawidget.php:1042
1136
  msgid "Tu"
1137
  msgstr ""
1138
 
1151
  "https://auth.xtraorbit.com</b>, then click <b>CREATE</b>."
1152
  msgstr ""
1153
 
1154
+ #: widgets/lrgawidget.php:431
1155
+ msgid "Upgrading to <b>Google Analytics 4</b> :"
1156
  msgstr ""
1157
 
1158
+ #: widgets/lrgawidget.php:539
1159
+ msgid "Users in last 30 minutes"
1160
  msgstr ""
1161
 
1162
+ #: widgets/lrgawidget.php:906
1163
  msgid "View all premuim features details"
1164
  msgstr ""
1165
 
 
 
 
 
1166
  #: widgets/lrgawidget.php:212 widgets/lrgawidget.php:334
1167
  msgid "View Search Console data for your verified sites"
1168
  msgstr ""
1169
 
 
 
 
 
 
 
 
 
1170
  #: widgets/lrgawidget.php:211 widgets/lrgawidget.php:333
1171
  msgid "View your Google Analytics data"
1172
  msgstr ""
1173
 
1174
+ #: widgets/lrgawidget.php:549
1175
+ msgid "Views"
1176
+ msgstr ""
1177
+
1178
+ #: widgets/lrgawidget.php:863
1179
  msgid "Visitors Countries"
1180
  msgstr ""
1181
 
1182
+ #: widgets/lrgawidget.php:1038
1183
  msgid "W"
1184
  msgstr ""
1185
 
1186
+ #: widgets/lrgawidget.php:1043
1187
  msgid "We"
1188
  msgstr ""
1189
 
1190
+ #: widgets/lrgawidget.php:925
1191
  msgid ""
1192
  "We mix creativity with imagination, responsibility with passion, and "
1193
  "resourcefulness with fun. That is what we do everyday within our company."
1194
  msgstr ""
1195
 
1196
+ #: widgets/lrgawidget.php:440
1197
+ msgid ""
1198
+ "When done, click <b>Reload</b>, to reload your Google Analytics properties."
1199
+ msgstr ""
1200
+
1201
+ #: widgets/lrgawidget.php:444
1202
+ msgid ""
1203
+ "When done, contact your WordPress administrator, to unlock your widget "
1204
+ "settings."
1205
+ msgstr ""
1206
+
1207
  #: widgets/lrgawidget.php:303
1208
  msgid ""
1209
  "When done, paste the <b>client ID</b> & <b>client secret</b> here and click "
1210
  "<b>Submit</b>."
1211
  msgstr ""
1212
 
1213
+ #: widgets/lrgawidget.php:923
1214
  msgid "Who we are & What we do"
1215
  msgstr ""
1216
 
1219
  msgid "WooCommerce"
1220
  msgstr ""
1221
 
1222
+ #: widgets/lrgawidget.php:396
1223
  msgid "Works in the Pro version only"
1224
  msgstr ""
1225
 
1226
  #. Author of the plugin
1227
+ msgid "XtraOrbit Web Development SRL"
1228
  msgstr ""
1229
 
1230
  #: core/lrgawidget.permissions.php:96
lara-google-analytics.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
 
3
  /*
4
- Plugin Name: Lara's Google Analytics
5
  Plugin URI: https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/
6
- Description: Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics tracking code to your pages.
7
- Version: 3.3.4
8
  Author: XtraOrbit Web Development SRL
9
  Author URI: https://www.xtraorbit.com/
10
  License: GPL2
@@ -15,9 +15,9 @@ Domain Path: /languages/
15
  if (!defined("ABSPATH"))
16
  die("This file cannot be accessed directly");
17
 
18
- define ("lrgawidget_plugin_version", "3.3.3");
19
  define ("lrgawidget_plugin_prefiex", "lrgalite-");
20
- define ("lrgawidget_plugin_scripts_version", "333");
21
  define ("lrgawidget_plugin_dir", dirname(__FILE__ ) . DIRECTORY_SEPARATOR);
22
  define ("lrgawidget_plugin_dir_url", plugin_dir_url( __FILE__ ));
23
  define ("lrgawidget_plugin_dist_url", lrgawidget_plugin_dir_url . 'dist/');
1
  <?php
2
 
3
  /*
4
+ Plugin Name: Lara's Google Analytics (GA4)
5
  Plugin URI: https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/
6
+ Description: Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics (GA4) tracking code to your pages.
7
+ Version: 4.0.0
8
  Author: XtraOrbit Web Development SRL
9
  Author URI: https://www.xtraorbit.com/
10
  License: GPL2
15
  if (!defined("ABSPATH"))
16
  die("This file cannot be accessed directly");
17
 
18
+ define ("lrgawidget_plugin_version", "4.0.0");
19
  define ("lrgawidget_plugin_prefiex", "lrgalite-");
20
+ define ("lrgawidget_plugin_scripts_version", "400");
21
  define ("lrgawidget_plugin_dir", dirname(__FILE__ ) . DIRECTORY_SEPARATOR);
22
  define ("lrgawidget_plugin_dir_url", plugin_dir_url( __FILE__ ));
23
  define ("lrgawidget_plugin_dist_url", lrgawidget_plugin_dir_url . 'dist/');
readme.txt CHANGED
@@ -1,23 +1,64 @@
1
- === Lara's Google Analytics ===
2
  Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
3
  Contributors: amribrahim, laragoogleanalytics
4
  Requires PHP: 5.6.0
5
  Requires at least: 4.7.0
6
- Tested up to: 6.1.0
7
- Stable tag: 3.3.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics tracking code to your pages.
12
 
13
  == Description ==
14
 
15
- <strong>Lara's Google Analytics.</strong>
16
 
17
- Adds a full width Google Analytics dashboard widget for WordPress admin interface, and inserts latest Google Analytics tracking code to all your pages.
18
 
19
  > Check a fully working demo, including all <strong>Google Analytics by Lara</strong> free and premium features at : [Google Analytics Dashboard Widget](https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/).
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  == Installation ==
22
  1. Download the plugin zip file.
23
  1. Using WordPress dashboard, click on **Plugins** then, **Add New**.
@@ -40,6 +81,10 @@ Adds a full width Google Analytics dashboard widget for WordPress admin interfac
40
  12. Google Analytics - Pro Version Only - Traffic Sources, showing who is sending you visitors.
41
 
42
  == Changelog ==
 
 
 
 
43
  = 3.3.4 =
44
  * 7-Sep-2022
45
  * Update : Google OAuth 2.0 redirect_uri
1
+ === Lara's Google Analytics (GA4) ===
2
  Tags: analytics,google analytics,google analytics dashboard,google analytics plugin,google analytics widget
3
  Contributors: amribrahim, laragoogleanalytics
4
  Requires PHP: 5.6.0
5
  Requires at least: 4.7.0
6
+ Tested up to: 6.2.0
7
+ Stable tag: 4.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Full width Google Analytics dashboard widget for Wordpress admin interface, which also inserts latest Google Analytics (GA4) tracking code to your pages.
12
 
13
  == Description ==
14
 
15
+ **Lara's Google Analytics (GA4)**
16
 
17
+ Adds a full width Google Analytics dashboard widget for WordPress admin interface, and inserts latest Google Analytics (GA4) tracking code to all your pages.
18
 
19
  > Check a fully working demo, including all <strong>Google Analytics by Lara</strong> free and premium features at : [Google Analytics Dashboard Widget](https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/).
20
 
21
+ * **Easy To Setup**, with **Express Setup** you'll be up and running in no time.
22
+ * **Full width** admin widget, with beautiful graphs.
23
+ * **eCommerce graphs** for WooCommerce.
24
+ * **Quick Overview**, full access to the following important **Google Analytics** metrics, for the last 30 days :
25
+ * Active Users
26
+ * New Users
27
+ * Sessions
28
+ * Screen Page Views
29
+ * Event Count
30
+ * Average Engagement Time
31
+ * Bounce Rate
32
+ * **Easy Access** to the following **GA4** visitors data streams:
33
+ * Most visited pages.
34
+ * Browsers.
35
+ * Languages.
36
+ * Operating Systems.
37
+ * Device Types
38
+ * Screen Resolutions.
39
+
40
+ > **Want more ?! .. There's a lot more!**
41
+ >
42
+ > Check the Pro/Premium features:
43
+ >
44
+ > By buying the Premium version, You'll get access to all these amazing features :
45
+ >
46
+ >* 12 months of free updates and support.
47
+ >* **Multisite Multi-Network enabled :** Every blog/site in your network can has its own analytics tracking code and dashboard widget.
48
+ >* **Permissions :** Easily control which data is viwed by your blog admins and users (also compatible with Multisite Multi-Network).
49
+ >* **Lock Settings :** Prevent users from changing the widget settings or viewing other Google analytics profiles.
50
+ >* **eCommerce graphs :** More customized earnings graphs options, for WooCommerce.
51
+ >* Check any date range, not just the last 30 days.
52
+ >* Access to all the following Google Analytics **GA4** metrics :
53
+ > * Keywords ( provided by **Google Search Console**).
54
+ > * Real Time site visitors.
55
+ > * Traffic sources.
56
+ > * Visitors Countries.
57
+ > * Operating Systems versions (Windows 7, Windows 8 .. etc.).
58
+ > * Device Types and brands (Samsung, Apple .. etc.).
59
+ >
60
+ > To get the **Premium** version, check the **Go Premium** tab in the widget.
61
+
62
  == Installation ==
63
  1. Download the plugin zip file.
64
  1. Using WordPress dashboard, click on **Plugins** then, **Add New**.
81
  12. Google Analytics - Pro Version Only - Traffic Sources, showing who is sending you visitors.
82
 
83
  == Changelog ==
84
+ = 4.0.0 =
85
+ * 15-Nov-2022
86
+ * Update : Google Analytics v4 (GA4) support.
87
+
88
  = 3.3.4 =
89
  * 7-Sep-2022
90
  * Update : Google OAuth 2.0 redirect_uri
widgets/lrgawidget.php CHANGED
@@ -114,7 +114,7 @@ if (!empty(DataStore::$RUNTIME["askforreview"])){
114
  <?php if (in_array("admin",DataStore::$RUNTIME["permissions"])){ ?>
115
 
116
  <?php } if (in_array("sessions",DataStore::$RUNTIME["permissions"])){ $actLrgaTabs[] = "lrgawidget_sessions_tab"; ?>
117
- <li><a data-toggle="tab" data-target="#lrgawidget_sessions_tab" href="#lrgawidget_sessions_tab"><i class="fas fa-chart-line fa-fw"></i><span class="hidden-xs hidden-sm"> <?php _e('Sessions', 'lara-google-analytics'); ?></span></a></li>
118
 
119
  <?php } if (in_array("pages",DataStore::$RUNTIME["permissions"])){ $actLrgaTabs[] = "lrgawidget_pages_tab"; ?>
120
  <li><a data-toggle="tab" data-target="#lrgawidget_pages_tab" href="#lrgawidget_pages_tab"><i class="far fa-file fa-fw"></i><span class="hidden-xs hidden-sm"> <?php _e('Pages', 'lara-google-analytics'); ?></span></a></li>
@@ -180,7 +180,7 @@ if (!empty(DataStore::$RUNTIME["askforreview"])){
180
  <ul class="steps">
181
  <li class="active" data-name="lrga-createApp" data-step="1"><span class="badge"><?php _e('1', 'lara-google-analytics'); ?></span><?php _e('Create Google APP', 'lara-google-analytics'); ?> <span class="chevron"></span></li>
182
  <li data-step="2" data-name="lrga-getCode"><span class="badge"><?php _e('2', 'lara-google-analytics'); ?></span><?php _e('Authorize APP', 'lara-google-analytics'); ?> <span class="chevron"></span></li>
183
- <li data-step="3" data-name="lrga-profile"><span class="badge"><?php _e('3', 'lara-google-analytics'); ?></span><?php _e('Select Analytics Profile', 'lara-google-analytics'); ?> <span class="chevron"></span></li>
184
  </ul>
185
  </div>
186
 
@@ -290,8 +290,8 @@ if (!empty(DataStore::$RUNTIME["askforreview"])){
290
  <ol>
291
  <li><?php _e('Open the <a target="_blank" href="//console.developers.google.com/apis/credentials?project=_">Google Developers Console</a>.', 'lara-google-analytics'); ?></li>
292
  <li><?php _e('Click on <b>CREATE PROJECT</b>, choose a <b>Project name</b>, then click <b>CREATE</b>.', 'lara-google-analytics'); ?></li>
293
- <li><?php _e('From the top <b>Search for APIs and Services</b> box, search for <b>Google Analytics API</b>, select it, then click <b>ENABLE</b>.', 'lara-google-analytics'); ?></li>
294
- <li><?php _e('Repeat the above step to enable <b>Google Analytics Reporting API</b> and <b>Google Search Console API</b>.', 'lara-google-analytics'); ?></li>
295
  <li><?php _e('Open <b>Google Developers Console</b> menu, by clicking on <i class="fas fa-bars fa-fw"></i> and select <b>APIs & Services</b> <i class="fas fa-caret-right fa-fw"></i> <b>OAuth consent screen</b>.', 'lara-google-analytics'); ?></li>
296
  <li><?php _e('Select <b>External</b> as the <b>User Type</b>, then click <b>CREATE</b>.', 'lara-google-analytics'); ?></li>
297
  <li><?php _e('On the next screen, choose an <b>Application name</b>, then click <b>Save</b>.', 'lara-google-analytics'); ?></li>
@@ -349,9 +349,8 @@ if (!empty(DataStore::$RUNTIME["askforreview"])){
349
  <div class="row">
350
  <div class="col-md-6">
351
 
352
- <form id="lrgawidget-setProfileID" name="lrgawidget-setProfileID" role="form">
353
- <input name="action" type="hidden" value="setProfileID">
354
- <input name="profile_timezone" type="hidden" value="">
355
  <div class="form-group">
356
  <label><?php _e('Account', 'lara-google-analytics'); ?></label>
357
  <select class="form-control" style="width: 100%;" id="lrgawidget-accounts" name="account_id">
@@ -363,15 +362,17 @@ if (!empty(DataStore::$RUNTIME["askforreview"])){
363
  </select>
364
  </div>
365
  <div class="form-group">
366
- <label><?php _e('View', 'lara-google-analytics'); ?></label>
367
- <select class="form-control" style="width: 100%;" id="lrgawidget-profiles" name="profile_id">
368
  </select>
369
  </div>
370
 
371
  <?php
 
 
372
  $traching_enabled = "";
373
- $enable_universal_tracking = DataStore::database_get("settings","enable_universal_tracking");
374
- if ($enable_universal_tracking !== "off"){
375
  $traching_enabled = "checked";
376
  }
377
 
@@ -384,8 +385,8 @@ if ($enable_ecommerce_graph !== "off"){
384
  ?>
385
 
386
  <div class="lrgawidget-settings-checkbox">
387
- <input name="enable_universal_tracking" id="enable_universal_tracking" <?php echo $traching_enabled ?> type="checkbox" value="on">
388
- <label for="enable_universal_tracking"><?php _e('Add <b>Google Universal Analytics</b> tracking code to all pages.', 'lara-google-analytics'); ?></label>
389
  </div>
390
  <div class="lrgawidget-settings-checkbox">
391
  <input name="enable_ecommerce_graph" id="enable_ecommerce_graph" <?php echo $ecommerce_graph_enabled ?> type="checkbox" value="on">
@@ -408,15 +409,15 @@ if ($enable_ecommerce_graph !== "off"){
408
  <h2 ><?php _e('Profile Details', 'lara-google-analytics'); ?></h2>
409
  <label><?php _e('Account Name', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-accname"></i>
410
  <br><label><?php _e('Property Name', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-propname"></i>
411
- <br><label><?php _e('Property WebsiteUrl', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-propurl"></i>
412
- <br><label><?php _e('View Name', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-vname"></i>
413
- <br><label><?php _e('View Type', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-vtype"></i>
414
- <br><label><?php _e('View Time Zone', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-vtimezone"></i> <i id="lrgawidget-timezone-show-error" class="icon fas fa-exclamation-triangle" style="display:none; color: #f39c12;margin-left: 5px;cursor: pointer;"></i>
415
  <div style="display:none; margin-top: 15px;" id="lrgawidget-timezone-error">
416
  <div class="alert alert-warning">
417
- <i class="icon fas fa-exclamation-triangle"></i><?php _e('The selected view is using a different timezone than your server\'s time zone, which <u>may</u> cause inaccurate dates/values.', 'lara-google-analytics'); ?>
418
  <div style="margin-left: 28px;margin-top: 10px;">
419
- <?php _e('View Time Zone', 'lara-google-analytics'); ?> : <b id="lrgawidget-tz-error-vtimezone"></b>
420
  <br> WordPress <?php _e('Time Zone', 'lara-google-analytics'); ?> : <b id="lrgawidget-tz-error-stimezone"></b>
421
  </div>
422
  </div>
@@ -425,10 +426,25 @@ if ($enable_ecommerce_graph !== "off"){
425
 
426
  <div>
427
  <div id="ga4-notfound-answer" class="alert" style="background-color: #eef7fb; margin-top:5px;">
428
- <p><b><?php _e('Cannot find your Google Analytics property ?', 'lara-google-analytics'); ?></b></p>
429
- <p><?php _e('If you have recently created a new property, you might not see it here, as the new Google API for <b>GA4</b> properties is still in <u><a href="https://developers.google.com/analytics/devguides/config/mgmt/v3" target="_blank">beta</a></u>.', 'lara-google-analytics'); ?></p>
430
- <p><?php _e('To overcome this limitation, when you create a <b>new</b> Google Analytics property, click on <b>Show Advanced Options</b> and then click on <b>Create a Universal Analytics Property</b>.', 'lara-google-analytics'); ?></p>
431
- <p><?php _e('This will allow the widget to access your newly created property.', 'lara-google-analytics'); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  </div>
433
  </div>
434
 
@@ -441,7 +457,7 @@ if ($enable_ecommerce_graph !== "off"){
441
  <br><br>
442
  <ol>
443
  <li> <?php _e('If you cannot find your website, please go to <a href="https://www.google.com/webmasters/tools/" target="_blank">Google Search Console</a> and click on <b>Add a property</b>, to add your website.', 'lara-google-analytics'); ?></li>
444
- <li> <?php _e('After adding your website to <b>Google Search Console</b> and verifying ownership, clich <b>Reload</b>, to reload the <b>Search Console Property URL</b> menu.', 'lara-google-analytics'); ?></li>
445
  </ol>
446
  <span class="pull-right"><a class="btn btn-primary" href="#" data-reload="lrgawidget_reload_tab"><?php _e('Reload', 'lara-google-analytics'); ?></a></span>
447
  </div>
@@ -489,56 +505,7 @@ if ($enable_ecommerce_graph !== "off"){
489
  <div id="lrga-xologoholder" class="hidden-xs"><a href="https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/?utm_source=InApp&utm_medium=Main_Screen" target="_blank"><img src="<?php echo lrgawidget_plugin_dist_url.'/img/xo_small_transp.png'; ?>"></a></div>
490
  <div class="box-footer hidden-xs hidden-sm" id="lrgawidget_sb-main">
491
  <div class="row">
492
- <div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_sessions" data-lrgawidget-plot="sessions">
493
- <div class="description-block border-right">
494
- <span class="description-text"><?php _e('Sessions', 'lara-google-analytics'); ?></span>
495
- <h5 class="description-header"></h5>
496
- <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_sessions"></div>
497
- </div><!-- /.description-block -->
498
- </div><!-- /.col -->
499
- <div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_users" data-lrgawidget-plot="users">
500
- <div class="description-block border-right">
501
- <span class="description-text"><?php _e('Users', 'lara-google-analytics'); ?></span>
502
- <h5 class="description-header"></h5>
503
- <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_users"></div>
504
- </div><!-- /.description-block -->
505
- </div><!-- /.col -->
506
- <div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_pageviews" data-lrgawidget-plot="pageviews">
507
- <div class="description-block border-right">
508
- <span class="description-text"><?php _e('Pageviews', 'lara-google-analytics'); ?></span>
509
- <h5 class="description-header"></h5>
510
- <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_pageviews"></div>
511
- </div><!-- /.description-block -->
512
- </div><!-- /.col -->
513
- <div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_pageviewsPerSession" data-lrgawidget-plot="pageviewsPerSession">
514
- <div class="description-block border-right">
515
- <span class="description-text"><?php _e('Pages / Session', 'lara-google-analytics'); ?></span>
516
- <h5 class="description-header"></h5>
517
- <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_pageviewsPerSession"></div>
518
- </div><!-- /.description-block -->
519
- </div>
520
- <div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_avgSessionDuration" data-lrgawidget-plot="avgSessionDuration">
521
- <div class="description-block border-right">
522
- <span class="description-text"><?php _e('Avg. Session Duration', 'lara-google-analytics'); ?></span>
523
- <h5 class="description-header"></h5>
524
- <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_avgSessionDuration"></div>
525
- </div><!-- /.description-block -->
526
- </div>
527
- <div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_bounceRate" data-lrgawidget-plot="bounceRate">
528
- <div class="description-block border-right">
529
- <span class="description-text"><?php _e('Bounce Rate', 'lara-google-analytics'); ?></span>
530
- <h5 class="description-header"></h5>
531
- <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_bounceRate"></div>
532
- </div><!-- /.description-block -->
533
- </div>
534
- <div class="col-sm-3 col-xs-6 lrgawidget_seven-cols" id="lrgawidget_sb_percentNewSessions" data-lrgawidget-plot="percentNewSessions">
535
- <div class="description-block">
536
- <span class="description-text"><?php _e('% New Sessions', 'lara-google-analytics'); ?></span>
537
- <h5 class="description-header"></h5>
538
- <div class="lrgawidget_inlinesparkline" id="lrgawidget_spline_percentNewSessions"></div>
539
- </div><!-- /.description-block -->
540
- </div>
541
- </div><!-- /.row -->
542
  </div>
543
  </div> <!-- /.tab-pane -->
544
  <?php } ?>
@@ -567,9 +534,9 @@ if ($enable_ecommerce_graph !== "off"){
567
  <div class="row" >
568
  <div class="col-md-6">
569
  <div id="lrgawidget_realtime_activenow">
570
- <div class="lrgawidget_realtime_rn"><?php _e('Right now', 'lara-google-analytics'); ?></div>
571
  <div id="lrgawidget_rttotal"><i class="fas fa-sync-alt fa-spin" style="margin-top: 25px;"></i></div>
572
- <div class="lrgawidget_realtime_an"><?php _e('active users on site', 'lara-google-analytics'); ?></div>
573
  </div>
574
  <div id="lrgawidget_realtime_dimensions_cn">
575
  <div id="lrgawidget_realtime_dimensions"></div>
@@ -579,7 +546,7 @@ if ($enable_ecommerce_graph !== "off"){
579
  <div>
580
  <div><h2><b><?php _e('Top Active Pages', 'lara-google-analytics'); ?></b></h2></div>
581
  <table id="lrgawidget_realtime_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
582
- <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Active Page', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
583
  <tbody></tbody>
584
  </table>
585
  </div>
@@ -594,7 +561,7 @@ if ($enable_ecommerce_graph !== "off"){
594
  <div class="col-md-6">
595
  <div>
596
  <table id="lrgawidget_countries_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%">
597
- <thead><tr><th><?php _e('Country', 'lara-google-analytics'); ?></th><th><?php _e('Sessions', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
598
  <tbody>
599
  </tbody>
600
  </table>
@@ -612,8 +579,8 @@ if ($enable_ecommerce_graph !== "off"){
612
  <div class="row">
613
  <div class="col-md-6">
614
  <div>
615
- <table id="lrgawidget_browsers_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" style="cursor:pointer">
616
- <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Browser', 'lara-google-analytics'); ?></th><th><?php _e('Sessions', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
617
  <tbody></tbody>
618
  </table>
619
  </div>
@@ -633,7 +600,7 @@ if ($enable_ecommerce_graph !== "off"){
633
  <div class="col-md-6">
634
  <div>
635
  <table id="lrgawidget_languages_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
636
- <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Language', 'lara-google-analytics'); ?></th><th><?php _e('Sessions', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
637
  <tbody></tbody>
638
  </table>
639
  </div>
@@ -653,7 +620,7 @@ if ($enable_ecommerce_graph !== "off"){
653
  <div class="col-md-6">
654
  <div>
655
  <table id="lrgawidget_os_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" style="cursor:pointer">
656
- <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Operating System', 'lara-google-analytics'); ?></th><th><?php _e('Sessions', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
657
  <tbody></tbody>
658
  </table>
659
  </div>
@@ -672,7 +639,7 @@ if ($enable_ecommerce_graph !== "off"){
672
  <div class="col-md-6">
673
  <div>
674
  <table id="lrgawidget_devices_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" style="cursor:pointer">
675
- <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Device Type', 'lara-google-analytics'); ?></th><th><?php _e('Sessions', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
676
  <tbody></tbody>
677
  </table>
678
  </div>
@@ -691,7 +658,7 @@ if ($enable_ecommerce_graph !== "off"){
691
  <div class="col-md-6">
692
  <div>
693
  <table id="lrgawidget_screenres_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
694
- <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Screen Resolution', 'lara-google-analytics'); ?></th><th><?php _e('Sessions', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
695
  <tbody></tbody>
696
  </table>
697
  </div>
@@ -735,7 +702,7 @@ if ($enable_ecommerce_graph !== "off"){
735
  <div class="col-md-6">
736
  <div>
737
  <table id="lrgawidget_sources_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
738
- <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Source', 'lara-google-analytics'); ?></th><th><?php _e('Sessions', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
739
  <tbody></tbody>
740
  </table>
741
  </div>
@@ -898,7 +865,6 @@ if ($enable_ecommerce_graph !== "off"){
898
  </div>
899
  <div class="col-md-6">
900
  <ul class="fa-ul">
901
- <li><i class="fa-li far fa-list-alt fa-lg fa-fw"></i><?php _e('Browsers versions (IE 6, IE 7 .. etc.).', 'lara-google-analytics'); ?></li>
902
  <li><i class="fa-li fas fa-desktop fa-lg fa-fw"></i><?php _e('Operating Systems versions (Windows 7, Windows 8 .. etc.).', 'lara-google-analytics'); ?></li>
903
  <li><i class="fa-li fas fa-tablet-alt fa-lg fa-fw"></i><?php _e('Device Types and brands (Samsung, Apple .. etc.).', 'lara-google-analytics'); ?></li>
904
  </ul>
@@ -1047,7 +1013,8 @@ if(!empty($actLrgaTabs[0])){
1047
  };
1048
  var lrwidgetenLang = { resetmsg : <?php echo '"'.__('All saved authentication data will be removed. Do you want to continue ?!', 'lara-google-analytics').'"'; ?>,
1049
  setuprequired : <?php echo '"'.__('Initial Setup Required! - Please contact an administratior to complete the widget setup.', 'lara-google-analytics').'"'; ?>,
1050
- selectproperty : <?php echo '"'.__('Select Property URL', 'lara-google-analytics').'"'; ?>,
 
1051
  emptygaconsole : <?php echo '"'.__('No data available in table. <span class=\'pull-left\'><ul><li>Did you <a href=\'https://support.google.com/webmasters/answer/34592?hl=en\' target=\'_blank\'>add your website to Google Search Console</a> ?</li><li>After adding your website to Google Search Console, did you save it as the <b>Search Console Property URL</b> in the widget <b>Settings</b> tab ?</li><li>If you have added your website recently, keywords may take some time to appear.</li></ul></span>', 'lara-google-analytics').'"'; ?>,
1052
  lastsevendays : <?php echo '"'.__('Last 7 Days', 'lara-google-analytics').'"'; ?>,
1053
  lastthirtydays : <?php echo '"'.__('Last 30 Days', 'lara-google-analytics').'"'; ?>,
@@ -1057,7 +1024,8 @@ if(!empty($actLrgaTabs[0])){
1057
  realtime : <?php echo '"'.__('Real Time', 'lara-google-analytics').'"'; ?>,
1058
  inactive : <?php echo '"'.__('inactive', 'lara-google-analytics').'"'; ?>,
1059
  total : <?php echo '"'.__('Total', 'lara-google-analytics').'"'; ?>,
1060
- noactiveusers : <?php echo '"'.__('No active users', 'lara-google-analytics').'"'; ?>
 
1061
  };
1062
 
1063
  var lrwidgetDateLang = { "format": "MM/DD/YYYY",
114
  <?php if (in_array("admin",DataStore::$RUNTIME["permissions"])){ ?>
115
 
116
  <?php } if (in_array("sessions",DataStore::$RUNTIME["permissions"])){ $actLrgaTabs[] = "lrgawidget_sessions_tab"; ?>
117
+ <li><a data-toggle="tab" data-target="#lrgawidget_sessions_tab" href="#lrgawidget_sessions_tab"><i class="fas fa-chart-line fa-fw"></i><span class="hidden-xs hidden-sm"> <?php _e('Graph', 'lara-google-analytics'); ?></span></a></li>
118
 
119
  <?php } if (in_array("pages",DataStore::$RUNTIME["permissions"])){ $actLrgaTabs[] = "lrgawidget_pages_tab"; ?>
120
  <li><a data-toggle="tab" data-target="#lrgawidget_pages_tab" href="#lrgawidget_pages_tab"><i class="far fa-file fa-fw"></i><span class="hidden-xs hidden-sm"> <?php _e('Pages', 'lara-google-analytics'); ?></span></a></li>
180
  <ul class="steps">
181
  <li class="active" data-name="lrga-createApp" data-step="1"><span class="badge"><?php _e('1', 'lara-google-analytics'); ?></span><?php _e('Create Google APP', 'lara-google-analytics'); ?> <span class="chevron"></span></li>
182
  <li data-step="2" data-name="lrga-getCode"><span class="badge"><?php _e('2', 'lara-google-analytics'); ?></span><?php _e('Authorize APP', 'lara-google-analytics'); ?> <span class="chevron"></span></li>
183
+ <li data-step="3" data-name="lrga-datastream"><span class="badge"><?php _e('3', 'lara-google-analytics'); ?></span><?php _e('Select Analytics Data Stream', 'lara-google-analytics'); ?> <span class="chevron"></span></li>
184
  </ul>
185
  </div>
186
 
290
  <ol>
291
  <li><?php _e('Open the <a target="_blank" href="//console.developers.google.com/apis/credentials?project=_">Google Developers Console</a>.', 'lara-google-analytics'); ?></li>
292
  <li><?php _e('Click on <b>CREATE PROJECT</b>, choose a <b>Project name</b>, then click <b>CREATE</b>.', 'lara-google-analytics'); ?></li>
293
+ <li><?php _e('From the top <b>Search for APIs and Services</b> box, search for <b>Google Analytics Admin API</b>, select it, then click <b>ENABLE</b>.', 'lara-google-analytics'); ?></li>
294
+ <li><?php _e('Repeat the above step to enable <b>Google Analytics Data API</b> and <b>Google Search Console API</b>.', 'lara-google-analytics'); ?></li>
295
  <li><?php _e('Open <b>Google Developers Console</b> menu, by clicking on <i class="fas fa-bars fa-fw"></i> and select <b>APIs & Services</b> <i class="fas fa-caret-right fa-fw"></i> <b>OAuth consent screen</b>.', 'lara-google-analytics'); ?></li>
296
  <li><?php _e('Select <b>External</b> as the <b>User Type</b>, then click <b>CREATE</b>.', 'lara-google-analytics'); ?></li>
297
  <li><?php _e('On the next screen, choose an <b>Application name</b>, then click <b>Save</b>.', 'lara-google-analytics'); ?></li>
349
  <div class="row">
350
  <div class="col-md-6">
351
 
352
+ <form id="lrgawidget-setMeasurementID" name="lrgawidget-setMeasurementID" role="form">
353
+ <input name="action" type="hidden" value="setMeasurementID">
 
354
  <div class="form-group">
355
  <label><?php _e('Account', 'lara-google-analytics'); ?></label>
356
  <select class="form-control" style="width: 100%;" id="lrgawidget-accounts" name="account_id">
362
  </select>
363
  </div>
364
  <div class="form-group">
365
+ <label><?php _e('Data Stream', 'lara-google-analytics'); ?></label>
366
+ <select class="form-control" style="width: 100%;" id="lrgawidget-dataStream" name="datastream_id">
367
  </select>
368
  </div>
369
 
370
  <?php
371
+ $lock_settings = DataStore::database_get("settings","lock_settings");
372
+
373
  $traching_enabled = "";
374
+ $enable_ga4_tracking = DataStore::database_get("settings","enable_ga4_tracking");
375
+ if ($enable_ga4_tracking !== "off"){
376
  $traching_enabled = "checked";
377
  }
378
 
385
  ?>
386
 
387
  <div class="lrgawidget-settings-checkbox">
388
+ <input name="enable_ga4_tracking" id="enable_ga4_tracking" <?php echo $traching_enabled ?> type="checkbox" value="on">
389
+ <label for="enable_ga4_tracking"><?php _e('Add <b>Google Analytics GA4</b> tracking code to all pages.', 'lara-google-analytics'); ?></label>
390
  </div>
391
  <div class="lrgawidget-settings-checkbox">
392
  <input name="enable_ecommerce_graph" id="enable_ecommerce_graph" <?php echo $ecommerce_graph_enabled ?> type="checkbox" value="on">
409
  <h2 ><?php _e('Profile Details', 'lara-google-analytics'); ?></h2>
410
  <label><?php _e('Account Name', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-accname"></i>
411
  <br><label><?php _e('Property Name', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-propname"></i>
412
+ <br><label><?php _e('Data Stream Name', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-dsname"></i>
413
+ <br><label><?php _e('Data Stream Url', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-dsrl"></i>
414
+ <br><label><?php _e('Data Stream Type', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-dstype"></i>
415
+ <br><label><?php _e('Property Time Zone', 'lara-google-analytics'); ?> :</label> <i id="lrgawidget-ptimezone"></i> <i id="lrgawidget-timezone-show-error" class="icon fas fa-exclamation-triangle" style="display:none; color: #f39c12;margin-left: 5px;cursor: pointer;"></i>
416
  <div style="display:none; margin-top: 15px;" id="lrgawidget-timezone-error">
417
  <div class="alert alert-warning">
418
+ <i class="icon fas fa-exclamation-triangle"></i><?php _e('The selected property is using a different timezone than your server\'s time zone, which <u>may</u> cause inaccurate dates/values.', 'lara-google-analytics'); ?>
419
  <div style="margin-left: 28px;margin-top: 10px;">
420
+ <?php _e('Property Time Zone', 'lara-google-analytics'); ?> : <b id="lrgawidget-tz-error-vtimezone"></b>
421
  <br> WordPress <?php _e('Time Zone', 'lara-google-analytics'); ?> : <b id="lrgawidget-tz-error-stimezone"></b>
422
  </div>
423
  </div>
426
 
427
  <div>
428
  <div id="ga4-notfound-answer" class="alert" style="background-color: #eef7fb; margin-top:5px;">
429
+ <p><b><?php _e('Cannot find your Google Universal Analytics property ?', 'lara-google-analytics'); ?></b></p>
430
+ <p><?php _e('Google will will stop processing data for Universal Analytics properties on July 1, 2023, so it is time to upgrade to the new GA4 properties.', 'lara-google-analytics'); ?></p>
431
+ <p><b><?php _e('Upgrading to <b>Google Analytics 4</b> :', 'lara-google-analytics'); ?></b></p>
432
+ <p style="margin-top:10px;">
433
+ <ol>
434
+ <li><?php _e('In <a target="_blank" href="//analytics.google.com/analytics/web/"> Google Analytics</a>, click <i class="fas fa-cog fa-fw"></i> Admin.', 'lara-google-analytics'); ?></li>
435
+ <li><?php _e('In the <b>Account</b> column, make sure that your desired account is selected.', 'lara-google-analytics'); ?></li>
436
+ <li><?php _e('In the <b>Property</b> column, select the Universal Analytics property that currently collects data for your website.', 'lara-google-analytics'); ?></li>
437
+ <li><?php _e('In the Property column, click <b>GA4 Setup Assistant</b>, then click <b>Get Started</b> under <u>I want to create a new Google Analytics 4 property</u>, then click on <b>Create and Continue</b>.', 'lara-google-analytics'); ?></li>
438
+ <li><?php _e('On the <b>Set up a Google tag</b> page, select <b>Install a Google tag </b> and click <b>Next</b>, then click <b>Done</b> on the next page.', 'lara-google-analytics'); ?></li>
439
+ <?php if ($lock_settings !== "on"){ ?>
440
+ <li> <?php _e('When done, click <b>Reload</b>, to reload your Google Analytics properties.', 'lara-google-analytics'); ?></li>
441
+ </ol>
442
+ <span class="pull-right"><a class="btn btn-primary" href="#" data-reload="lrgawidget_reload_tab"><?php _e('Reload', 'lara-google-analytics'); ?></a></span>
443
+ <?php }else{ ?>
444
+ <li> <?php _e('When done, contact your WordPress administrator, to unlock your widget settings.', 'lara-google-analytics'); ?></li>
445
+ </ol>
446
+ <?php } ?>
447
+ </p>
448
  </div>
449
  </div>
450
 
457
  <br><br>
458
  <ol>
459
  <li> <?php _e('If you cannot find your website, please go to <a href="https://www.google.com/webmasters/tools/" target="_blank">Google Search Console</a> and click on <b>Add a property</b>, to add your website.', 'lara-google-analytics'); ?></li>
460
+ <li> <?php _e('After adding your website to <b>Google Search Console</b> and verifying ownership, click <b>Reload</b>, to reload the <b>Search Console Property URL</b> menu.', 'lara-google-analytics'); ?></li>
461
  </ol>
462
  <span class="pull-right"><a class="btn btn-primary" href="#" data-reload="lrgawidget_reload_tab"><?php _e('Reload', 'lara-google-analytics'); ?></a></span>
463
  </div>
505
  <div id="lrga-xologoholder" class="hidden-xs"><a href="https://www.xtraorbit.com/wordpress-google-analytics-dashboard-widget/?utm_source=InApp&utm_medium=Main_Screen" target="_blank"><img src="<?php echo lrgawidget_plugin_dist_url.'/img/xo_small_transp.png'; ?>"></a></div>
506
  <div class="box-footer hidden-xs hidden-sm" id="lrgawidget_sb-main">
507
  <div class="row">
508
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
  </div>
510
  </div> <!-- /.tab-pane -->
511
  <?php } ?>
534
  <div class="row" >
535
  <div class="col-md-6">
536
  <div id="lrgawidget_realtime_activenow">
537
+ <div class="lrgawidget_realtime_rn"><?php _e('Realtime Overview', 'lara-google-analytics'); ?></div>
538
  <div id="lrgawidget_rttotal"><i class="fas fa-sync-alt fa-spin" style="margin-top: 25px;"></i></div>
539
+ <div class="lrgawidget_realtime_an"><?php _e('Users in last 30 minutes', 'lara-google-analytics'); ?></div>
540
  </div>
541
  <div id="lrgawidget_realtime_dimensions_cn">
542
  <div id="lrgawidget_realtime_dimensions"></div>
546
  <div>
547
  <div><h2><b><?php _e('Top Active Pages', 'lara-google-analytics'); ?></b></h2></div>
548
  <table id="lrgawidget_realtime_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
549
+ <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Active Page', 'lara-google-analytics'); ?></th><th><?php _e('Views', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
550
  <tbody></tbody>
551
  </table>
552
  </div>
561
  <div class="col-md-6">
562
  <div>
563
  <table id="lrgawidget_countries_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%">
564
+ <thead><tr><th><?php _e('Country', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
565
  <tbody>
566
  </tbody>
567
  </table>
579
  <div class="row">
580
  <div class="col-md-6">
581
  <div>
582
+ <table id="lrgawidget_browsers_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%">
583
+ <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Browser', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
584
  <tbody></tbody>
585
  </table>
586
  </div>
600
  <div class="col-md-6">
601
  <div>
602
  <table id="lrgawidget_languages_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
603
+ <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Language', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
604
  <tbody></tbody>
605
  </table>
606
  </div>
620
  <div class="col-md-6">
621
  <div>
622
  <table id="lrgawidget_os_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" style="cursor:pointer">
623
+ <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Operating System', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
624
  <tbody></tbody>
625
  </table>
626
  </div>
639
  <div class="col-md-6">
640
  <div>
641
  <table id="lrgawidget_devices_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" style="cursor:pointer">
642
+ <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Device Type', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
643
  <tbody></tbody>
644
  </table>
645
  </div>
658
  <div class="col-md-6">
659
  <div>
660
  <table id="lrgawidget_screenres_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
661
+ <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Screen Resolution', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
662
  <tbody></tbody>
663
  </table>
664
  </div>
702
  <div class="col-md-6">
703
  <div>
704
  <table id="lrgawidget_sources_dataTable" class="table table-bordered table-hover" cellspacing="0" width="100%" >
705
+ <thead><tr><th><?php _e('ID', 'lara-google-analytics'); ?></th><th><?php _e('Source', 'lara-google-analytics'); ?></th><th><?php _e('Active Users', 'lara-google-analytics'); ?></th><th><?php _e('Percentage', 'lara-google-analytics'); ?></th></tr></thead>
706
  <tbody></tbody>
707
  </table>
708
  </div>
865
  </div>
866
  <div class="col-md-6">
867
  <ul class="fa-ul">
 
868
  <li><i class="fa-li fas fa-desktop fa-lg fa-fw"></i><?php _e('Operating Systems versions (Windows 7, Windows 8 .. etc.).', 'lara-google-analytics'); ?></li>
869
  <li><i class="fa-li fas fa-tablet-alt fa-lg fa-fw"></i><?php _e('Device Types and brands (Samsung, Apple .. etc.).', 'lara-google-analytics'); ?></li>
870
  </ul>
1013
  };
1014
  var lrwidgetenLang = { resetmsg : <?php echo '"'.__('All saved authentication data will be removed. Do you want to continue ?!', 'lara-google-analytics').'"'; ?>,
1015
  setuprequired : <?php echo '"'.__('Initial Setup Required! - Please contact an administratior to complete the widget setup.', 'lara-google-analytics').'"'; ?>,
1016
+ selectproperty : <?php echo '"'.__('Select Property', 'lara-google-analytics').'"'; ?>,
1017
+ selectpropertyurl : <?php echo '"'.__('Select Property URL', 'lara-google-analytics').'"'; ?>,
1018
  emptygaconsole : <?php echo '"'.__('No data available in table. <span class=\'pull-left\'><ul><li>Did you <a href=\'https://support.google.com/webmasters/answer/34592?hl=en\' target=\'_blank\'>add your website to Google Search Console</a> ?</li><li>After adding your website to Google Search Console, did you save it as the <b>Search Console Property URL</b> in the widget <b>Settings</b> tab ?</li><li>If you have added your website recently, keywords may take some time to appear.</li></ul></span>', 'lara-google-analytics').'"'; ?>,
1019
  lastsevendays : <?php echo '"'.__('Last 7 Days', 'lara-google-analytics').'"'; ?>,
1020
  lastthirtydays : <?php echo '"'.__('Last 30 Days', 'lara-google-analytics').'"'; ?>,
1024
  realtime : <?php echo '"'.__('Real Time', 'lara-google-analytics').'"'; ?>,
1025
  inactive : <?php echo '"'.__('inactive', 'lara-google-analytics').'"'; ?>,
1026
  total : <?php echo '"'.__('Total', 'lara-google-analytics').'"'; ?>,
1027
+ noactiveusers : <?php echo '"'.__('No active users', 'lara-google-analytics').'"'; ?>,
1028
+ activeusers : <?php echo '"'.__('Active Users', 'lara-google-analytics').'"'; ?>
1029
  };
1030
 
1031
  var lrwidgetDateLang = { "format": "MM/DD/YYYY",