|
1 | | -/* Simple Analytics - Privacy friendly analytics (docs.simpleanalytics.com/script; 2022-07-26; 2f79; v9) */ |
| 1 | +/* Simple Analytics - Privacy friendly analytics (docs.simpleanalytics.com/script; 2022-09-05; 9974; v10) */ |
2 | 2 | /* eslint-env browser */ |
3 | 3 |
|
4 | 4 | (function ( |
|
113 | 113 | : []; |
114 | 114 | }; |
115 | 115 |
|
| 116 | + var isObject = function (object) { |
| 117 | + return object && object.constructor === Object; |
| 118 | + }; |
| 119 | + |
| 120 | + var assign = function () { |
| 121 | + var to = {}; |
| 122 | + var arg = arguments; |
| 123 | + for (var index = 0; index < arg.length; index++) { |
| 124 | + var nextSource = arg[index]; |
| 125 | + if (isObject(nextSource)) { |
| 126 | + for (var nextKey in nextSource) { |
| 127 | + if (hasProp(nextSource, nextKey)) { |
| 128 | + to[nextKey] = nextSource[nextKey]; |
| 129 | + } |
| 130 | + } |
| 131 | + } |
| 132 | + } |
| 133 | + return to; |
| 134 | + }; |
| 135 | + |
| 136 | + // Merge overwriteOptions with sa_settings |
| 137 | + overwriteOptions = assign(overwriteOptions, window.sa_settings); |
| 138 | + |
116 | 139 | // Customers can skip data points |
117 | 140 | var ignoreMetrics = convertCommaSeparatedToArray( |
118 | 141 | overwriteOptions.ignoreMetrics || attr(scriptElement, "ignore-metrics") |
|
155 | 178 | return typeof func == "function"; |
156 | 179 | }; |
157 | 180 |
|
158 | | - var isObject = function (object) { |
159 | | - return object && object.constructor === Object; |
160 | | - }; |
161 | | - |
162 | | - var assign = function () { |
163 | | - var to = {}; |
164 | | - var arg = arguments; |
165 | | - for (var index = 0; index < arg.length; index++) { |
166 | | - var nextSource = arg[index]; |
167 | | - if (isObject(nextSource)) { |
168 | | - for (var nextKey in nextSource) { |
169 | | - if (hasProp(nextSource, nextKey)) { |
170 | | - to[nextKey] = nextSource[nextKey]; |
171 | | - } |
172 | | - } |
173 | | - } |
174 | | - } |
175 | | - return to; |
176 | | - }; |
177 | | - |
178 | 181 | // Define namespace for the library |
179 | 182 | var namespaceText = "namespace"; |
180 | 183 | var namespace = |
|
873 | 876 | } |
874 | 877 | }; |
875 | 878 |
|
876 | | - var defaultEventFunc = function (event, callback) { |
877 | | - sendEvent(event, callback); |
| 879 | + var defaultEventFunc = function (event, metadata, callback) { |
| 880 | + sendEvent(event, metadata, callback); |
878 | 881 | }; |
879 | 882 |
|
880 | 883 | // Set default function if user didn't define a function |
|
905 | 908 | {"saGlobal":INSTALL_OPTIONS.sa_global,"mode":INSTALL_OPTIONS.hash_mode ? 'hash' : null,"collectDnt":INSTALL_OPTIONS.collect_dnt}, |
906 | 909 | INSTALL_OPTIONS.custom_domain || "queue.simpleanalyticscdn.com", |
907 | 910 | "", |
908 | | - "cloudflare_9", |
| 911 | + "cloudflare_10", |
909 | 912 | "sa" |
910 | 913 | ); |
0 commit comments