PluginProbe
Simple Analytics / 1.89
Simple Analytics v1.89
1.109 1.108 1.107 1.106 1.73 1.74 1.75 1.76 1.77 1.78 1.79 1.8 1.80 1.81 1.82 1.83 1.84 1.85 1.86 1.87 1.88 1.89 1.9 1.90 1.91 All 98 releases
simpleanalytics / src / Scripts / AutomatedEventsScript.php

AutomatedEventsScript.php in Simple Analytics 1.89, at src/Scripts/AutomatedEventsScript.php

34 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SimpleAnalytics\Scripts;
4
5 use SimpleAnalytics\Scripts\Contracts\HasAttributes;
6 use SimpleAnalytics\Scripts\Contracts\HideScriptId;
7 use SimpleAnalytics\Scripts\Contracts\Script;
8 use SimpleAnalytics\Setting;
9 use SimpleAnalytics\SettingName;
10
11 class AutomatedEventsScript implements Script, HasAttributes, HideScriptId
12 {
13 public function path(): string
14 {
15 return sprintf("https://%s/auto-events.js", Setting::get(SettingName::CUSTOM_DOMAIN, 'scripts.simpleanalyticscdn.com'));
16 }
17
18 public function handle(): string
19 {
20 return 'simpleanalytics_auto_events';
21 }
22
23 public function attributes(): array
24 {
25 return array_filter([
26 'data-collect' => Setting::get(SettingName::EVENT_COLLECT_DOWNLOADS),
27 'data-extensions' => Setting::get(SettingName::EVENT_EXTENSIONS),
28 'data-use-title' => Setting::get(SettingName::EVENT_USE_TITLE),
29 'data-full-urls' => Setting::get(SettingName::EVENT_FULL_URLS),
30 'data-sa-global' => Setting::get(SettingName::EVENT_SA_GLOBAL),
31 ]);
32 }
33 }
34