Event Tracking for Gravity Forms - Version 1.7.3

Version Description

  • Bugfix - Some users were experiencing PHP fatal errors upon form submission. Reverting to previously used library.
Download this release

Release Info

Developer ronalfy
Plugin Icon 128x128 Event Tracking for Gravity Forms
Version 1.7.3
Comparing to
See all releases

Code changes from version 1.7.1 to 1.7.3

README.txt CHANGED
@@ -2,10 +2,11 @@
2
  Contributors: nmarks, ronalfy
3
  Tags: gravity forms, google analytics, event tracking
4
  Requires at least:4.0
5
- Tested up to: 4.5
6
- Stable tag: 1.7.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
 
9
 
10
  Add Google Analytics Event Tracking to your Gravity Forms in less than 5 minutes! Requires PHP 5.3+.
11
 
@@ -91,6 +92,9 @@ Check out the documentation on [github](https://github.com/ronalfy/wordpress-gra
91
 
92
  == Changelog ==
93
 
 
 
 
94
  = 1.7.1 =
95
  * Released 2016-03-28
96
  * Hotfix - Removing SSL requirement. Needs more testing.
@@ -171,6 +175,9 @@ Check out the documentation on [github](https://github.com/ronalfy/wordpress-gra
171
 
172
  == Upgrade Notice ==
173
 
 
 
 
174
  = 1.7.1 =
175
  Removing SSL requirement. Needs more testing.
176
 
2
  Contributors: nmarks, ronalfy
3
  Tags: gravity forms, google analytics, event tracking
4
  Requires at least:4.0
5
+ Tested up to: 4.6
6
+ Stable tag: 1.7.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+ Donate link: https://mediaron.com/contribute/
10
 
11
  Add Google Analytics Event Tracking to your Gravity Forms in less than 5 minutes! Requires PHP 5.3+.
12
 
92
 
93
  == Changelog ==
94
 
95
+ = 1.7.3 =
96
+ * Bugfix - Some users were experiencing PHP fatal errors upon form submission. Reverting to previously used library.
97
+
98
  = 1.7.1 =
99
  * Released 2016-03-28
100
  * Hotfix - Removing SSL requirement. Needs more testing.
175
 
176
  == Upgrade Notice ==
177
 
178
+ = 1.7.3 =
179
+ Bugfix - Some users were experiencing PHP fatal errors upon form submission. Reverting to previously used library.
180
+
181
  = 1.7.1 =
182
  Removing SSL requirement. Needs more testing.
183
 
gravity-forms-event-tracking.php CHANGED
@@ -10,9 +10,9 @@
10
  * Plugin Name: Gravity Forms Google Analytics Event Tracking
11
  * Plugin URI: https://wordpress.org/plugins/gravity-forms-google-analytics-event-tracking/
12
  * Description: Add Google Analytics event tracking to your Gravity Forms with ease.
13
- * Version: 1.7.1
14
  * Author: Ronald Huereca
15
- * Author URI: http://mediaron.com
16
  * Text Domain: gravity-forms-google-analytics-event-tracking
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
10
  * Plugin Name: Gravity Forms Google Analytics Event Tracking
11
  * Plugin URI: https://wordpress.org/plugins/gravity-forms-google-analytics-event-tracking/
12
  * Description: Add Google Analytics event tracking to your Gravity Forms with ease.
13
+ * Version: 1.7.3
14
  * Author: Ronald Huereca
15
+ * Author URI: https://mediaron.com
16
  * Text Domain: gravity-forms-google-analytics-event-tracking
17
  * License: GPL-2.0+
18
  * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
includes/vendor/ga-mp/src/Racecore/GATracking/Autoloader.php CHANGED
@@ -1,73 +1,74 @@
1
- <?php
2
-
3
- namespace Racecore\GATracking;
4
-
5
- /**
6
- * Google Analytics Measurement PHP Class
7
- * Licensed under the 3-clause BSD License.
8
- * This source file is subject to the 3-clause BSD License that is
9
- * bundled with this package in the LICENSE file. It is also available at
10
- * the following URL: http://www.opensource.org/licenses/BSD-3-Clause
11
- *
12
- * Google Documentation
13
- * https://developers.google.com/analytics/devguides/collection/protocol/v1/
14
- *
15
- * @author Marco Rieger
16
- * @email Rieger(at)racecore.de
17
- * @git https://github.com/ins0
18
- * @url http://www.racecore.de
19
- * @package Racecore\GATracking
20
- */
21
- class Autoloader
22
- {
23
- private $folder;
24
-
25
- /**
26
- * Constructor
27
- *
28
- * @param string $folder
29
- */
30
- public function __construct($folder = null)
31
- {
32
- if (!$folder) {
33
- $folder = dirname(__FILE__) . '/..';
34
- }
35
-
36
- $this->folder = $folder;
37
- }
38
-
39
- /**
40
- * Handel autoloading of classes
41
- *
42
- * @param $class
43
- * @return bool|mixed
44
- */
45
- public function autoload($class)
46
- {
47
- $filePath = $this->folder . '/' . str_replace('\\', '/', $class) . '.php';
48
-
49
- if (file_exists($filePath)) {
50
- return ( (require_once $filePath) === false ? true : false );
51
- }
52
-
53
- return false;
54
- }
55
-
56
- /**
57
- * Register SPL Autoload
58
- *
59
- * @param null $folder
60
- * @return bool
61
- */
62
- public static function register($folder = null)
63
- {
64
- ini_set('unserialize_callback_func', 'spl_autoload_call');
65
-
66
- return spl_autoload_register(
67
- array(
68
- new self($folder),
69
- 'autoload'
70
- )
71
- );
72
- }
73
- }
 
1
+ <?php
2
+ namespace Racecore\GATracking;
3
+
4
+ /**
5
+ * Google Analytics Measurement PHP Class
6
+ * Licensed under the 3-clause BSD License.
7
+ * This source file is subject to the 3-clause BSD License that is
8
+ * bundled with this package in the LICENSE file. It is also available at
9
+ * the following URL: http://www.opensource.org/licenses/BSD-3-Clause
10
+ *
11
+ * Google Documentation
12
+ * https://developers.google.com/analytics/devguides/collection/protocol/v1/
13
+ *
14
+ * @author Marco Rieger
15
+ * @email Rieger(at)racecore.de
16
+ * @git https://github.com/ins0
17
+ * @url http://www.racecore.de
18
+ * @package Racecore\GATracking
19
+ */
20
+ class Autoloader
21
+ {
22
+ private $folder;
23
+
24
+ /**
25
+ * Constructor
26
+ *
27
+ * @param string $folder
28
+ */
29
+ public function __construct( $folder = null )
30
+ {
31
+ if ( ! $folder )
32
+ {
33
+ $folder = dirname(__FILE__) . '/..';
34
+ }
35
+
36
+ $this->folder = $folder;
37
+ }
38
+
39
+ /**
40
+ * Handel autoloading of classes
41
+ *
42
+ * @param $class
43
+ * @return bool|mixed
44
+ */
45
+ public function autoload( $class )
46
+ {
47
+ $filePath = $this->folder . '/' . str_replace('\\', '/', $class) . '.php';
48
+
49
+ if (file_exists($filePath))
50
+ {
51
+ return ( (require_once $filePath) === false ? true : false );
52
+ }
53
+
54
+ return false;
55
+ }
56
+
57
+ /**
58
+ * Register SPL Autoload
59
+ *
60
+ * @param null $folder
61
+ * @return bool
62
+ */
63
+ public static function register( $folder = null )
64
+ {
65
+ ini_set('unserialize_callback_func', 'spl_autoload_call');
66
+
67
+ return spl_autoload_register(
68
+ array(
69
+ new self($folder),
70
+ 'autoload'
71
+ )
72
+ );
73
+ }
74
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Exception.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking;
4
 
5
  /**
@@ -18,6 +17,6 @@ namespace Racecore\GATracking;
18
  * @url http://www.racecore.de
19
  * @package Racecore\GATracking
20
  */
21
- class Exception extends \Exception
22
  {
23
- }
1
  <?php
 
2
  namespace Racecore\GATracking;
3
 
4
  /**
17
  * @url http://www.racecore.de
18
  * @package Racecore\GATracking
19
  */
20
+ class Exception extends \UnexpectedValueException
21
  {
22
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Exception/EndpointServerException.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Exception;
4
 
5
  use Racecore\GATracking\Exception;
@@ -22,4 +21,4 @@ use Racecore\GATracking\Exception;
22
  */
23
  class EndpointServerException extends Exception
24
  {
25
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Exception;
3
 
4
  use Racecore\GATracking\Exception;
21
  */
22
  class EndpointServerException extends Exception
23
  {
24
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Exception/MissingConfigurationException.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Exception;
4
 
5
  use Racecore\GATracking\Exception;
@@ -22,4 +21,4 @@ use Racecore\GATracking\Exception;
22
  */
23
  class MissingConfigurationException extends Exception
24
  {
25
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Exception;
3
 
4
  use Racecore\GATracking\Exception;
21
  */
22
  class MissingConfigurationException extends Exception
23
  {
24
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Exception/MissingTrackingParameterException.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Exception;
4
 
5
  use Racecore\GATracking\Exception;
@@ -22,4 +21,4 @@ use Racecore\GATracking\Exception;
22
  */
23
  class MissingTrackingParameterException extends Exception
24
  {
25
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Exception;
3
 
4
  use Racecore\GATracking\Exception;
21
  */
22
  class MissingTrackingParameterException extends Exception
23
  {
24
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/GATracking.php CHANGED
@@ -1,11 +1,9 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking;
4
 
5
- use Racecore\GATracking\Request;
6
- use Racecore\GATracking\Client;
7
- use Racecore\GATracking\Exception;
8
- use Racecore\GATracking\Tracking;
9
 
10
  /**
11
  * Google Analytics Measurement PHP Class
@@ -25,213 +23,211 @@ use Racecore\GATracking\Tracking;
25
  */
26
  class GATracking
27
  {
28
- /** @var null */
29
- private $analyticsAccountUid = null;
30
-
31
- /** @var array */
32
- private $options = array(
33
- 'client_create_random_id' => true, // create a random client id when the class can't fetch the current client id or none is provided by "client_id"
34
- 'client_fallback_id' => 555, // fallback client id when cid was not found and random client id is off
35
- 'client_id' => null, // override client id
36
- 'user_id' => null, // determine current user id
37
-
38
- // adapter options
39
- 'adapter' => array(
40
- 'async' => true, // requests to google are async - don't wait for google server response
41
- 'ssl' => false // use ssl connection to google server
42
- )
43
-
44
- // use proxy
45
- /**
46
- 'proxy' => array(
47
- 'ip' => '127.0.0.1', // override the proxy ip with this one
48
- 'user_agent' => 'override agent' // override the proxy user agent
49
- ),
50
- **/
51
- );
52
-
53
- /** @var Client\AbstractClientAdapter */
54
- private $clientAdapter = null;
55
-
56
- /** @var string */
57
- private $apiProtocolVersion = '1';
58
- private $apiEndpointUrl = 'http://www.google-analytics.com/collect';
59
 
60
  /**
61
- * @param $analyticsAccountUid
62
- * @param array $options
63
- * @param Client\AbstractClientAdapter $clientAdapter
64
- * @throws Exception\InvalidArgumentException
65
  */
66
- public function __construct($analyticsAccountUid, $options = array(), Client\AbstractClientAdapter $clientAdapter = null)
67
- {
68
- if (empty($analyticsAccountUid)) {
69
- throw new Exception\InvalidArgumentException('Google Account/Tracking ID not provided');
70
- }
 
 
 
71
 
72
- $this->analyticsAccountUid = $analyticsAccountUid;
 
 
 
 
 
73
 
74
- if (!class_exists('Racecore\GATracking\Client\Adapter\Socket')) {
75
- require_once( dirname(__FILE__) . '/Autoloader.php');
76
- Autoloader::register(dirname(__FILE__).'/../../../src/');
77
- }
 
 
78
 
79
- if (!$clientAdapter) {
80
- $clientAdapter = new Client\Adapter\Socket();
81
- }
82
- $this->setClientAdapter($clientAdapter);
 
 
83
 
84
- if (!empty($options)) {
85
- $this->setOptions(
86
- array_merge($this->options, $options)
87
- );
88
- }
89
- }
90
 
91
  /**
92
- * Return Analytics Account ID
 
 
 
 
 
 
 
93
  *
94
- * @return null
95
  */
96
- public function getAnalyticsAccountUid()
 
 
 
 
 
 
 
97
  {
98
- return $this->analyticsAccountUid;
99
  }
100
-
101
  /**
102
- * Set the Analytics Account ID
103
  *
104
- * @param null $analyticsAccountUid
105
  */
106
- public function setAnalyticsAccountUid($analyticsAccountUid)
107
  {
108
- $this->analyticsAccountUid = $analyticsAccountUid;
109
  }
110
 
111
  /**
112
- * Get the current Client Adapter
113
  *
114
- * @return Client\AbstractClientAdapter
115
  */
116
- public function getClientAdapter()
117
  {
118
- return $this->clientAdapter;
 
119
  }
120
 
121
  /**
122
- * Set the current Client Adapter
123
  *
124
- * @param Client\AbstractClientAdapter $adapter
 
125
  */
126
- public function setClientAdapter(Client\AbstractClientAdapter $adapter)
127
  {
128
- $this->clientAdapter = $adapter;
 
129
  }
130
 
131
  /**
132
- * Set Options
133
  *
134
- * @param $options
135
- * @throws Exception\InvalidArgumentException
136
  */
137
- public function setOptions($options)
138
  {
139
- if (!is_array($options)) {
140
- throw new Exception\InvalidArgumentException(sprintf(
141
- '[%s] expects array; received [%s]',
142
- __METHOD__,
143
- gettype($options)
144
- ));
145
  }
146
 
147
- $this->options = $options;
148
  }
149
-
150
  /**
151
- * Set single Option
152
  *
153
- * @param $key
154
- * @param $value
155
  */
156
- public function setOption($key, $value)
157
  {
158
- if (isset($this->options[$key]) && is_array($this->options[$key]) && is_array($value)) {
159
- $oldValues = $this->options[$key];
160
- $value = array_merge($oldValues, $value);
161
- }
162
 
163
- $this->options[$key] = $value;
 
 
 
 
 
 
 
164
  }
165
 
166
  /**
167
- * Return Options
168
  *
169
  * @return array
170
  */
171
- public function getOptions()
172
  {
173
- return $this->options;
174
  }
175
 
176
  /**
177
- * Return Single Option
178
  *
179
- * @param $key
180
- * @return null|mixed
181
  */
182
- public function getOption($key)
183
  {
184
- if (!isset($this->options[$key])) {
185
- return null;
186
- }
187
-
188
- return $this->options[$key];
189
  }
190
 
191
  /**
192
- * Sets the used clientId
193
  *
194
- * @param $clientId
 
195
  */
196
- public function setClientId($clientId)
197
  {
198
- $this->setOption('client_id', $clientId);
 
 
 
199
  }
200
 
201
  /**
202
- * Return the Current Client Id
203
  *
204
  * @return string
205
  */
206
- public function getClientId()
207
  {
208
- $clientId = $this->getOption('client_id');
209
- if ($clientId) {
210
- return $clientId;
211
- }
212
-
213
  // collect user specific data
214
  if (isset($_COOKIE['_ga'])) {
 
215
  $gaCookie = explode('.', $_COOKIE['_ga']);
216
- if (isset($gaCookie[2])) {
 
217
  // check if uuid
218
- if ($this->checkUuid($gaCookie[2])) {
 
219
  // uuid set in cookie
220
  return $gaCookie[2];
221
- } elseif (isset($gaCookie[2]) && isset($gaCookie[3])) {
222
- // google old client id
 
 
223
  return $gaCookie[2] . '.' . $gaCookie[3];
224
  }
225
  }
226
  }
227
 
228
- // nothing found - fallback
229
- $generateClientId = $this->getOption('client_create_random_id');
230
- if ($generateClientId) {
231
- return $this->generateUuid();
232
- }
233
-
234
- return $this->getOption('client_fallback_id');
235
  }
236
 
237
  /**
@@ -240,12 +236,9 @@ class GATracking
240
  * @param $uuid
241
  * @return int
242
  */
243
- final private function checkUuid($uuid)
244
  {
245
- return preg_match(
246
- '#^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$#i',
247
- $uuid
248
- );
249
  }
250
 
251
  /**
@@ -254,132 +247,231 @@ class GATracking
254
  * @author Andrew Moore http://www.php.net/manual/en/function.uniqid.php#94959
255
  * @return string
256
  */
257
- final private function generateUuid()
258
- {
259
- return sprintf(
260
- '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
261
  // 32 bits for "time_low"
262
- mt_rand(0, 0xffff),
263
- mt_rand(0, 0xffff),
264
  // 16 bits for "time_mid"
265
- mt_rand(0, 0xffff),
 
266
  // 16 bits for "time_hi_and_version",
267
  // four most significant bits holds version number 4
268
- mt_rand(0, 0x0fff) | 0x4000,
 
269
  // 16 bits, 8 bits for "clk_seq_hi_res",
270
  // 8 bits for "clk_seq_low",
271
  // two most significant bits holds zero and one for variant DCE1.1
272
- mt_rand(0, 0x3fff) | 0x8000,
 
273
  // 48 bits for "node"
274
- mt_rand(0, 0xffff),
275
- mt_rand(0, 0xffff),
276
- mt_rand(0, 0xffff)
277
  );
278
  }
279
 
280
  /**
281
- * Build the Tracking Payload Data
 
282
  *
283
- * @param Tracking\AbstractTracking $event
284
- * @return array
285
- * @throws Exception\MissingConfigurationException
286
  */
287
- protected function getTrackingPayloadData(Tracking\AbstractTracking $event)
288
  {
289
- $payloadData = $event->getPackage();
290
- $payloadData['v'] = $this->apiProtocolVersion; // protocol version
291
- $payloadData['tid'] = $this->analyticsAccountUid; // account id
292
- $payloadData['uid'] = $this->getOption('user_id');
293
- $payloadData['cid'] = $this->getClientId();
294
-
295
- $proxy = $this->getOption('proxy');
296
- if ($proxy) {
297
- if (!isset($proxy['ip'])) {
298
- throw new Exception\MissingConfigurationException('proxy options need "ip" key/value');
299
- }
300
 
301
- if (isset($proxy['user_agent'])) {
302
- $payloadData['ua'] = $proxy['user_agent'];
303
- }
 
 
 
 
304
 
305
- $payloadData['uip'] = $proxy['ip'];
 
 
 
 
 
 
 
 
 
 
 
306
  }
307
 
308
- return array_filter($payloadData);
 
 
 
 
 
 
 
 
 
 
 
309
  }
310
 
311
  /**
312
- * Call the client adapter
313
  *
314
- * @param $tracking
315
- * @throws Exception\InvalidArgumentException
316
  * @throws Exception\MissingConfigurationException
317
- * @return Request\TrackingRequestCollection
318
  */
319
- private function callEndpoint($tracking)
320
  {
321
- $trackingHolder = is_array($tracking) ? $tracking : array($tracking);
322
- $trackingCollection = new Request\TrackingRequestCollection();
323
 
324
- foreach ($trackingHolder as $tracking) {
325
- if (!$tracking instanceof Tracking\AbstractTracking) {
326
- continue;
327
- }
328
-
329
- $payloadData = $this->getTrackingPayloadData($tracking);
330
 
331
- $trackingRequest = new Request\TrackingRequest($payloadData);
332
- $trackingCollection->add($trackingRequest);
 
 
 
 
 
333
  }
 
 
 
 
 
 
334
 
335
- $adapterOptions = $this->getOption('adapter');
336
- $clientAdapter = $this->clientAdapter;
337
- $clientAdapter->setOptions($adapterOptions);
338
 
339
- return $clientAdapter->send($this->apiEndpointUrl, $trackingCollection);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
340
  }
341
 
342
  /**
343
- * Create a Tracking Class Instance - eg. "Event" or "Ecommerce\Transaction"
344
  *
345
- * @param $className
346
- * @param null $options
347
  * @return bool
 
348
  */
349
- public function createTracking($className, $options = null)
350
  {
351
- if (strstr(strtolower($className), 'abstracttracking')) {
352
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
353
  }
354
 
355
- $class = 'Racecore\GATracking\Tracking\\' . $className;
356
- if ($options) {
357
- return new $class($options);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
  }
359
- return new $class;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  }
361
 
362
  /**
363
- * Send single tracking request
364
  *
365
- * @param Tracking\AbstractTracking $tracking
366
- * @return Tracking\AbstractTracking
367
  */
368
- public function sendTracking(Tracking\AbstractTracking $tracking)
369
  {
370
- $responseCollection = $this->callEndpoint($tracking);
371
- $responseCollection->rewind();
372
- return $responseCollection->current();
373
  }
374
 
375
  /**
376
- * Send multiple tracking request
377
  *
378
- * @param $array
379
- * @return Request\TrackingRequestCollection
380
  */
381
- public function sendMultipleTracking($array)
382
  {
383
- return $this->callEndpoint($array);
 
 
384
  }
385
- }
1
  <?php
 
2
  namespace Racecore\GATracking;
3
 
4
+ use Racecore\GATracking\Exception\EndpointServerException;
5
+ use Racecore\GATracking\Exception\MissingConfigurationException;
6
+ use Racecore\GATracking\Tracking\AbstractTracking;
 
7
 
8
  /**
9
  * Google Analytics Measurement PHP Class
23
  */
24
  class GATracking
25
  {
26
+ /**
27
+ * Google Analytics Account ID UA-...
28
+ *
29
+ * @var
30
+ */
31
+ private $accountID;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
  /**
34
+ * Current User Client ID
35
+ *
36
+ * @var string
 
37
  */
38
+ private $clientID;
39
+
40
+ /**
41
+ * Current User ID
42
+ *
43
+ * @var string
44
+ */
45
+ private $userID = null;
46
 
47
+ /**
48
+ * Protocol Version
49
+ *
50
+ * @var string
51
+ */
52
+ private $protocol = '1';
53
 
54
+ /**
55
+ * Analytics Endpoint URL
56
+ *
57
+ * @var string
58
+ */
59
+ private $analytics_endpoint = 'http://www.google-analytics.com/collect';
60
 
61
+ /**
62
+ * Tacking Holder
63
+ *
64
+ * @var array
65
+ */
66
+ private $tracking_holder = array();
67
 
68
+ /**
69
+ * Holds the last Response from Google Analytics Server
70
+ *
71
+ * @var string
72
+ */
73
+ private $last_response = null;
74
 
75
  /**
76
+ * Holds all Responses from GA Server
77
+ *
78
+ * @var array
79
+ */
80
+ private $last_response_stack = array();
81
+
82
+ /**
83
+ * Send Proxy Variables
84
  *
85
+ * @var boolean
86
  */
87
+ private $use_proxy;
88
+
89
+ /**
90
+ * Sets the Use Proxy variable
91
+ *
92
+ * @param $proxy
93
+ */
94
+ public function setProxy($proxy)
95
  {
96
+ $this->use_proxy = $proxy;
97
  }
98
+
99
  /**
100
+ * Returns the Use Proxy variable
101
  *
102
+ * @return boolean
103
  */
104
+ public function getProxy()
105
  {
106
+ return $this->use_proxy;
107
  }
108
 
109
  /**
110
+ * Sets the Analytics Account ID
111
  *
112
+ * @param $account
113
  */
114
+ public function setAccountID($account)
115
  {
116
+
117
+ $this->accountID = $account;
118
  }
119
 
120
  /**
121
+ * Set the current Client ID
122
  *
123
+ * @param $clientID
124
+ * @return $this
125
  */
126
+ public function setClientID($clientID)
127
  {
128
+ $this->clientID = $clientID;
129
+ return $this;
130
  }
131
 
132
  /**
133
+ * Returns the current Client ID
134
  *
135
+ * @return string
 
136
  */
137
+ public function getClientID()
138
  {
139
+ if (!$this->clientID) {
140
+ $this->clientID = $this->createClientID();
 
 
 
 
141
  }
142
 
143
+ return $this->clientID;
144
  }
145
+
146
  /**
147
+ * Set the current User ID
148
  *
149
+ * @param $clientID
150
+ * @return $this
151
  */
152
+ public function setUserID($userID)
153
  {
154
+ $this->userID = $userID;
155
+ return $this;
156
+ }
 
157
 
158
+ /**
159
+ * Returns the current User ID
160
+ *
161
+ * @return string
162
+ */
163
+ public function getUserID()
164
+ {
165
+ return $this->userID;
166
  }
167
 
168
  /**
169
+ * Return all registered Events
170
  *
171
  * @return array
172
  */
173
+ public function getEvents()
174
  {
175
+ return $this->tracking_holder;
176
  }
177
 
178
  /**
179
+ * Returns current Google Account ID
180
  *
181
+ * @return mixed
 
182
  */
183
+ public function getAccountID()
184
  {
185
+ return $this->accountID;
 
 
 
 
186
  }
187
 
188
  /**
189
+ * Constructor
190
  *
191
+ * @param string $accountID
192
+ * @param boolean $proxy (default: false)
193
  */
194
+ public function __construct( $accountID = null, $proxy = false )
195
  {
196
+ $this->setAccountID( $accountID );
197
+ $this->setProxy($proxy);
198
+
199
+ return $this;
200
  }
201
 
202
  /**
203
+ * Create a GUID on Client specific values
204
  *
205
  * @return string
206
  */
207
+ private function createClientID()
208
  {
 
 
 
 
 
209
  // collect user specific data
210
  if (isset($_COOKIE['_ga'])) {
211
+
212
  $gaCookie = explode('.', $_COOKIE['_ga']);
213
+ if( isset($gaCookie[2] ) )
214
+ {
215
  // check if uuid
216
+ if( $this->checkUUID( $gaCookie[2] ) )
217
+ {
218
  // uuid set in cookie
219
  return $gaCookie[2];
220
+ }
221
+ elseif( isset($gaCookie[2]) && isset($gaCookie[3]) )
222
+ {
223
+ // google default client id
224
  return $gaCookie[2] . '.' . $gaCookie[3];
225
  }
226
  }
227
  }
228
 
229
+ // nothing found - return random uuid client id
230
+ return $this->generateUUID();
 
 
 
 
 
231
  }
232
 
233
  /**
236
  * @param $uuid
237
  * @return int
238
  */
239
+ private function checkUUID( $uuid )
240
  {
241
+ return preg_match('#^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$#i', $uuid );
 
 
 
242
  }
243
 
244
  /**
247
  * @author Andrew Moore http://www.php.net/manual/en/function.uniqid.php#94959
248
  * @return string
249
  */
250
+ private function generateUUID() {
251
+ return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
 
 
252
  // 32 bits for "time_low"
253
+ mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
254
+
255
  // 16 bits for "time_mid"
256
+ mt_rand( 0, 0xffff ),
257
+
258
  // 16 bits for "time_hi_and_version",
259
  // four most significant bits holds version number 4
260
+ mt_rand( 0, 0x0fff ) | 0x4000,
261
+
262
  // 16 bits, 8 bits for "clk_seq_hi_res",
263
  // 8 bits for "clk_seq_low",
264
  // two most significant bits holds zero and one for variant DCE1.1
265
+ mt_rand( 0, 0x3fff ) | 0x8000,
266
+
267
  // 48 bits for "node"
268
+ mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
 
 
269
  );
270
  }
271
 
272
  /**
273
+ * Send all captured Trackings to Analytics Server
274
+ * Flush all prev. captured tracking responses
275
  *
276
+ * @return bool
 
 
277
  */
278
+ public function send()
279
  {
280
+ // clear response logs
281
+ $this->last_response_stack = array();
282
+ $this->last_response = null;
 
 
 
 
 
 
 
 
283
 
284
+ /** @var AbstractTracking $event */
285
+ foreach ($this->tracking_holder as $tracking) {
286
+ $this->sendTracking($tracking);
287
+ }
288
+
289
+ return true;
290
+ }
291
 
292
+ /**
293
+ * Returns the Client IP
294
+ * The last octect of the IP address is removed to anonymize the user
295
+ *
296
+ * @param string $address
297
+ * @return string
298
+ */
299
+ function getClientIP($address = '')
300
+ {
301
+
302
+ if (!$address) {
303
+ $address = $_SERVER['REMOTE_ADDR'];
304
  }
305
 
306
+ if (!$address) {
307
+ return '';
308
+ }
309
+
310
+ // Capture the first three octects of the IP address and replace the forth
311
+ // with 0, e.g. 124.455.3.123 becomes 124.455.3.0
312
+ $regex = "/^([^.]+\.[^.]+\.[^.]+\.).*/";
313
+ if (preg_match($regex, $address, $matches)) {
314
+ return $matches[1] . '0';
315
+ }
316
+
317
+ return '';
318
  }
319
 
320
  /**
321
+ * Build the POST Packet
322
  *
323
+ * @param AbstractTracking $event
324
+ * @return string
325
  * @throws Exception\MissingConfigurationException
 
326
  */
327
+ private function buildPacket( AbstractTracking $event )
328
  {
329
+ // get packet
330
+ $eventPacket = $event->getPaket();
331
 
332
+ if( ! $this->getAccountID() )
333
+ {
334
+ throw new MissingConfigurationException('Google Account ID is missing');
335
+ }
 
 
336
 
337
+ // Add Protocol
338
+ $eventPacket['v'] = $this->protocol; // protocol version
339
+ $eventPacket['tid'] = $this->getAccountID(); // account id
340
+ $eventPacket['cid'] = $this->getClientID(); // client id
341
+
342
+ if($this->getUserID() != null){
343
+ $eventPacket['uid'] = $this->getUserID();
344
  }
345
+
346
+ //Proxy Variables
347
+ if($this->getProxy()){
348
+ $eventPacket['uip'] = $_SERVER['REMOTE_ADDR']; // IP Override
349
+ $eventPacket['ua'] = $_SERVER['HTTP_USER_AGENT']; // UA Override
350
+ }
351
 
352
+ $eventPacket = array_reverse($eventPacket);
 
 
353
 
354
+ // build query
355
+ return http_build_query($eventPacket);
356
+ }
357
+
358
+ /**
359
+ * Send an Event to Google Analytics
360
+ * Will be removed
361
+ *
362
+ * @param AbstractTracking $tracking
363
+ * @return bool
364
+ * @throws Exception\EndpointServerException
365
+ * @deprecated Use sendTracking
366
+ */
367
+ public function sendEvent(AbstractTracking $tracking)
368
+ {
369
+ return $this->sendTracking($tracking);
370
  }
371
 
372
  /**
373
+ * Send an Event to Google Analytics
374
  *
375
+ * @param AbstractTracking $event
 
376
  * @return bool
377
+ * @throws Exception\EndpointServerException
378
  */
379
+ public function sendTracking(AbstractTracking $event)
380
  {
381
+ // get packet
382
+ $eventPacket = $this->buildPacket( $event );
383
+
384
+ // get endpoint
385
+ $endpoint = parse_url($this->analytics_endpoint);
386
+
387
+ // port
388
+ $port = ($endpoint['scheme'] == 'https' ? 443 : 80);
389
+
390
+ // connect
391
+ $connection = @fsockopen($endpoint['scheme'] == 'https' ? 'ssl://' : $endpoint['host'], $port, $error, $errorstr, 10);
392
+
393
+ if (!$connection) {
394
+ throw new EndpointServerException('Analytics Host not reachable!');
395
  }
396
 
397
+ $header = 'POST ' . $endpoint['path'] . ' HTTP/1.1' . "\r\n" .
398
+ 'Host: ' . $endpoint['host'] . "\r\n" .
399
+ 'User-Agent: Google-Measurement-PHP-Client' . "\r\n" .
400
+ 'Content-Type: application/x-www-form-urlencoded' . "\r\n" .
401
+ 'Content-Length: ' . strlen($eventPacket) . "\r\n" .
402
+ 'Connection: Close' . "\r\n\r\n";
403
+
404
+ $this->last_response = '';
405
+
406
+ // frwite data
407
+ fwrite($connection, $header);
408
+ fwrite($connection, $eventPacket);
409
+
410
+ // response
411
+ $response = '';
412
+
413
+ // receive response
414
+ while (!feof($connection)) {
415
+ $response .= fgets($connection, 1024);
416
  }
417
+
418
+ // response
419
+ $responseContainer = explode("\r\n\r\n", $response, 2);
420
+ $responseContainer[0] = explode("\r\n", $responseContainer[0]);
421
+
422
+ // save last response
423
+ $this->addResponse( $responseContainer );
424
+
425
+ // connection close
426
+ fclose($connection);
427
+
428
+ return true;
429
+ }
430
+
431
+ /**
432
+ * Add a Response to the Stack
433
+ *
434
+ * @param $response
435
+ * @return bool
436
+ */
437
+ public function addResponse( $response )
438
+ {
439
+ $this->last_response_stack[] = $response;
440
+ $this->last_response = $response;
441
+ return true;
442
+ }
443
+
444
+ /**
445
+ * Returns the last Response from Google Analytics Server
446
+ *
447
+ * @author Marco Rieger
448
+ * @return string
449
+ */
450
+ public function getLastResponse()
451
+ {
452
+ return $this->last_response;
453
  }
454
 
455
  /**
456
+ * Returns all Responses since the last Send Method Call
457
  *
458
+ * @return array
 
459
  */
460
+ public function getLastResponseStack()
461
  {
462
+ return $this->last_response_stack;
 
 
463
  }
464
 
465
  /**
466
+ * Add Tracking Event
467
  *
468
+ * @param AbstractTracking $tracking
469
+ * @return $this
470
  */
471
+ public function addTracking(AbstractTracking $tracking)
472
  {
473
+ $this->tracking_holder[] = $tracking;
474
+
475
+ return $this;
476
  }
477
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/AbstractTracking.php CHANGED
@@ -1,508 +1,685 @@
1
- <?php
2
-
3
- namespace Racecore\GATracking\Tracking;
4
-
5
- use Racecore\GATracking\Exception;
6
-
7
- /**
8
- * Google Analytics Measurement PHP Class
9
- * Licensed under the 3-clause BSD License.
10
- * This source file is subject to the 3-clause BSD License that is
11
- * bundled with this package in the LICENSE file. It is also available at
12
- * the following URL: http://www.opensource.org/licenses/BSD-3-Clause
13
- *
14
- * Google Documentation
15
- * https://developers.google.com/analytics/devguides/collection/protocol/v1/
16
- *
17
- * @author Marco Rieger
18
- * @email Rieger(at)racecore.de
19
- * @git https://github.com/ins0
20
- * @url http://www.racecore.de
21
- * @package Racecore\GATracking\Tracking
22
- */
23
- abstract class AbstractTracking
24
- {
25
- // document referrer
26
- /** @var String */
27
- private $documentReferrer;
28
-
29
- // campaign
30
- /** @var String */
31
- private $campaignName;
32
- private $campaignSource;
33
- private $campaignMedium;
34
- private $campaignContent;
35
- private $campaignID;
36
- private $campaignKeyword;
37
-
38
- // adwords id
39
- /** @var String */
40
- private $adwordsID;
41
-
42
- // display ads id
43
- /** @var String */
44
- private $displayAdsID;
45
-
46
- // screen resolution
47
- /** @var String */
48
- private $screenResolution;
49
-
50
- // viewport size
51
- /** @var String */
52
- private $viewportSize;
53
-
54
- // document encoding
55
- /** @var String */
56
- private $documentEncoding;
57
-
58
- // screen colors
59
- /** @var String */
60
- private $screenColors;
61
-
62
- // user language
63
- /** @var String */
64
- private $userLanguage;
65
-
66
- // java enabled
67
- /** @var boolean|string */
68
- private $javaEnabled = null;
69
-
70
- // flash version
71
- /** @var String */
72
- private $flashVersion;
73
-
74
- // document location
75
- /** @var String */
76
- private $documentLocation;
77
-
78
- // document host
79
- /** @var String */
80
- private $documentHost;
81
-
82
- // document path
83
- /** @var String */
84
- private $documentPath;
85
-
86
- // document title
87
- /** @var String */
88
- private $documentTitle;
89
-
90
- // app name
91
- /** @var String */
92
- private $appName;
93
-
94
- // app version
95
- /** @var String */
96
- private $appVersion;
97
-
98
- // experiment id
99
- /** @var String */
100
- private $experimentID;
101
-
102
- // experiment variant
103
- /** @var String */
104
- private $experimentVariant;
105
-
106
- // content description
107
- /** @var String */
108
- private $contentDescription;
109
-
110
- // link id
111
- /** @var String */
112
- private $linkID;
113
-
114
- // custom dimensions
115
- /** @var Array */
116
- private $customDimension = array();
117
-
118
- // custom metric
119
- /** @var Array */
120
- private $customMetric = array();
121
-
122
- // productId
123
- /** @var string */
124
- private $productId;
125
-
126
- // non interactive hit
127
- private $nonInteractionHit = false;
128
-
129
- private $customPayload = array();
130
-
131
- // event queue time difference
132
- private $queueTime;
133
-
134
- /**
135
- * Add Custom Tracking Payload Data send to Google
136
- * @param $key
137
- * @param $value
138
- * @throws Exception\InvalidArgumentException
139
- */
140
- public function addCustomPayloadData($key, $value)
141
- {
142
- if (!is_string($value)) {
143
- throw new Exception\InvalidArgumentException('Custom payload data value must be a string');
144
- }
145
-
146
- $this->customPayload[$key] = $value;
147
- }
148
-
149
- /**
150
- * Get the transfer Paket from current Event
151
- *
152
- * @return array
153
- */
154
- abstract public function createPackage();
155
-
156
- /**
157
- * @return array
158
- */
159
- public function getPackage()
160
- {
161
- $package = array_merge($this->createPackage(), array(
162
- // campaign
163
- 'cn' => $this->campaignName,
164
- 'cs' => $this->campaignSource,
165
- 'cm' => $this->campaignMedium,
166
- 'ck' => $this->campaignKeyword,
167
- 'cc' => $this->campaignContent,
168
- 'ci' => $this->campaignID,
169
-
170
- // other
171
- 'dr' => $this->documentReferrer,
172
- 'gclid' => $this->adwordsID,
173
- 'dclid' => $this->displayAdsID,
174
-
175
- // system info
176
- 'sr' => $this->screenResolution,
177
- 'sd' => $this->screenColors,
178
- 'vp' => $this->viewportSize,
179
- 'de' => $this->documentEncoding,
180
- 'ul' => $this->userLanguage,
181
- 'je' => $this->javaEnabled,
182
- 'fl' => $this->flashVersion,
183
-
184
- // Content Information
185
- 'dl' => $this->documentLocation,
186
- 'dh' => $this->documentHost,
187
- 'dp' => $this->documentPath,
188
- 'dt' => $this->documentTitle,
189
- 'cd' => $this->contentDescription,
190
- 'linkid' => $this->linkID,
191
-
192
- // app tracking
193
- 'an' => $this->appName,
194
- 'av' => $this->appVersion,
195
-
196
- // non interactive hit
197
- 'ni' => $this->nonInteractionHit,
198
-
199
- // content experiments
200
- 'xid' => $this->experimentID,
201
- 'xvar' => $this->experimentVariant,
202
-
203
- // optional
204
- 'qt' => $this->queueTime,
205
- ));
206
-
207
- $package = $this->addCustomParameters($package);
208
-
209
- // custom payload data
210
- $package = array_merge($package, $this->customPayload);
211
-
212
- // remove all unused
213
- $package = array_filter($package, 'strlen');
214
-
215
- return $package;
216
- }
217
-
218
- /**
219
- * Set the Tracking Processing Time to pass the qt param within this tracking request
220
- * ATTENTION!: Values greater than four hours may lead to hits not being processed.
221
- *
222
- * https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#qt
223
- *
224
- * @param $milliseconds
225
- */
226
- public function setQueueTime($milliseconds)
227
- {
228
- $this->queueTime = $milliseconds;
229
- }
230
-
231
- /**
232
- * Mark the Hit as Non Interactive
233
- *
234
- * @param $bool
235
- */
236
- public function setAsNonInteractionHit($bool)
237
- {
238
- $this->nonInteractionHit = (bool) $bool;
239
- }
240
-
241
- /**
242
- * @param array $package
243
- * @return array
244
- */
245
- private function addCustomParameters($package)
246
- {
247
- // add custom metric params
248
- foreach ($this->customMetric as $id => $value) {
249
- $package['cm' . (int) $id ] = $value;
250
- }
251
-
252
- // add custom dimension params
253
- foreach ($this->customDimension as $id => $value) {
254
- $package['cd' . (int) $id ] = $value;
255
- }
256
-
257
- return $package;
258
- }
259
-
260
- /**
261
- * @param null $identifier
262
- * @param $value
263
- */
264
- public function setCustomDimension($value, $identifier = null)
265
- {
266
- $this->customDimension[$identifier] = $value;
267
- }
268
-
269
- /**
270
- * @param null $identifier
271
- * @param $value
272
- */
273
- public function setCustomMetric($value, $identifier = null)
274
- {
275
- $this->customMetric[$identifier] = $value;
276
- }
277
-
278
- /**
279
- * @param String $contentDescription
280
- */
281
- public function setContentDescription($contentDescription)
282
- {
283
- $this->contentDescription = $contentDescription;
284
- }
285
-
286
- /**
287
- * @param String $linkID
288
- */
289
- public function setLinkID($linkID)
290
- {
291
- $this->linkID = $linkID;
292
- }
293
-
294
- /**
295
- * @param String $adwordsID
296
- */
297
- public function setAdwordsID($adwordsID)
298
- {
299
- $this->adwordsID = $adwordsID;
300
- }
301
-
302
- /**
303
- * @param String $appName
304
- */
305
- public function setAppName($appName)
306
- {
307
- $this->appName = $appName;
308
- }
309
-
310
- /**
311
- * @param String $appVersion
312
- */
313
- public function setAppVersion($appVersion)
314
- {
315
- $this->appVersion = $appVersion;
316
- }
317
-
318
- /**
319
- * @param String $campaignContent
320
- */
321
- public function setCampaignContent($campaignContent)
322
- {
323
- $this->campaignContent = $campaignContent;
324
- }
325
-
326
- /**
327
- * @param String $campaignID
328
- */
329
- public function setCampaignID($campaignID)
330
- {
331
- $this->campaignID = $campaignID;
332
- }
333
-
334
- /**
335
- * @param String $campaignKeyword
336
- */
337
- public function setCampaignKeyword($campaignKeyword)
338
- {
339
- $this->campaignKeyword = $campaignKeyword;
340
- }
341
-
342
- /**
343
- * @deprecated Use setCampaignKeyword
344
- * @param $campaignKeyword
345
- */
346
- public function setCampaignKeywords($campaignKeyword)
347
- {
348
- if (is_array($campaignKeyword)) {
349
- $campaignKeyword = implode(',', $campaignKeyword);
350
- }
351
-
352
- $this->setCampaignKeyword($campaignKeyword);
353
- }
354
-
355
- /**
356
- * @param String $campaignMedium
357
- */
358
- public function setCampaignMedium($campaignMedium)
359
- {
360
- $this->campaignMedium = $campaignMedium;
361
- }
362
-
363
- /**
364
- * @param String $campaignName
365
- */
366
- public function setCampaignName($campaignName)
367
- {
368
- $this->campaignName = $campaignName;
369
- }
370
-
371
- /**
372
- * @param String $campaignSource
373
- */
374
- public function setCampaignSource($campaignSource)
375
- {
376
- $this->campaignSource = $campaignSource;
377
- }
378
-
379
- /**
380
- * @param String $displayAdsID
381
- */
382
- public function setDisplayAdsID($displayAdsID)
383
- {
384
- $this->displayAdsID = $displayAdsID;
385
- }
386
-
387
- /**
388
- * @param String $documentEncoding
389
- */
390
- public function setDocumentEncoding($documentEncoding)
391
- {
392
- $this->documentEncoding = $documentEncoding;
393
- }
394
-
395
- /**
396
- * @param String $documentHost
397
- */
398
- public function setDocumentHost($documentHost)
399
- {
400
- $this->documentHost = $documentHost;
401
- }
402
-
403
- /**
404
- * @param String $documentLocation
405
- */
406
- public function setDocumentLocation($documentLocation)
407
- {
408
- $this->documentLocation = $documentLocation;
409
- }
410
-
411
- /**
412
- * @param String $documentPath
413
- */
414
- public function setDocumentPath($documentPath)
415
- {
416
- $this->documentPath = $documentPath;
417
- }
418
-
419
- /**
420
- * @param String $documentReferrer
421
- */
422
- public function setDocumentReferrer($documentReferrer)
423
- {
424
- $this->documentReferrer = $documentReferrer;
425
- }
426
-
427
- /**
428
- * @param String $documentTitle
429
- */
430
- public function setDocumentTitle($documentTitle)
431
- {
432
- $this->documentTitle = $documentTitle;
433
- }
434
-
435
- /**
436
- * @param String $experimentID
437
- */
438
- public function setExperimentID($experimentID)
439
- {
440
- $this->experimentID = $experimentID;
441
- }
442
-
443
- /**
444
- * @param String $experimentVariant
445
- */
446
- public function setExperimentVariant($experimentVariant)
447
- {
448
- $this->experimentVariant = $experimentVariant;
449
- }
450
-
451
- /**
452
- * @param String $flashVersion
453
- */
454
- public function setFlashVersion($flashVersion)
455
- {
456
- $this->flashVersion = $flashVersion;
457
- }
458
-
459
- /**
460
- * @param boolean $javaEnabled
461
- */
462
- public function setJavaEnabled($javaEnabled)
463
- {
464
- $this->javaEnabled = (bool) $javaEnabled;
465
- }
466
-
467
- /**
468
- * @param String $screenColors
469
- */
470
- public function setScreenColors($screenColors)
471
- {
472
- $this->screenColors = $screenColors;
473
- }
474
-
475
- /**
476
- * @param $width
477
- * @param $height
478
- */
479
- public function setScreenResolution($width, $height)
480
- {
481
- $this->screenResolution = $width . 'x' . $height;
482
- }
483
-
484
- /**
485
- * @param String $userLanguage
486
- */
487
- public function setUserLanguage($userLanguage)
488
- {
489
- $this->userLanguage = $userLanguage;
490
- }
491
-
492
- /**
493
- * @param $width
494
- * @param $height
495
- */
496
- public function setViewportSize($width, $height)
497
- {
498
- $this->viewportSize = $width . 'x' . $height;
499
- }
500
-
501
- /**
502
- * @param string $productId
503
- */
504
- public function setProductId($productId)
505
- {
506
- $this->productId = $productId;
507
- }
508
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Racecore\GATracking\Tracking;
3
+
4
+ /**
5
+ * Google Analytics Measurement PHP Class
6
+ * Licensed under the 3-clause BSD License.
7
+ * This source file is subject to the 3-clause BSD License that is
8
+ * bundled with this package in the LICENSE file. It is also available at
9
+ * the following URL: http://www.opensource.org/licenses/BSD-3-Clause
10
+ *
11
+ * Google Documentation
12
+ * https://developers.google.com/analytics/devguides/collection/protocol/v1/
13
+ *
14
+ * @author Marco Rieger
15
+ * @email Rieger(at)racecore.de
16
+ * @git https://github.com/ins0
17
+ * @url http://www.racecore.de
18
+ * @package Racecore\GATracking\Tracking
19
+ */
20
+ abstract class AbstractTracking
21
+ {
22
+ // document referrer
23
+ /** @var String */
24
+ private $documentReferrer;
25
+
26
+ // campaign
27
+ /** @var String */
28
+ private $campaignName, $campaignSource, $campaignMedium, $campaignContent, $campaignID, $campaignKeyword;
29
+
30
+ // adwords id
31
+ /** @var String */
32
+ private $adwordsID;
33
+
34
+ // display ads id
35
+ /** @var String */
36
+ private $displayAdsID;
37
+
38
+ // screen resolution
39
+ /** @var String */
40
+ private $screenResolution;
41
+
42
+ // viewport size
43
+ /** @var String */
44
+ private $viewportSize;
45
+
46
+ // document encoding
47
+ /** @var String */
48
+ private $documentEncoding;
49
+
50
+ // screen colors
51
+ /** @var String */
52
+ private $screenColors;
53
+
54
+ // user language
55
+ /** @var String */
56
+ private $userLanguage;
57
+
58
+ // java enabled
59
+ /** @var boolean|string */
60
+ private $javaEnabled = null;
61
+
62
+ // flash version
63
+ /** @var String */
64
+ private $flashVersion;
65
+
66
+ // document location
67
+ /** @var String */
68
+ private $documentLocation;
69
+
70
+ // document host
71
+ /** @var String */
72
+ private $documentHost;
73
+
74
+ // document path
75
+ /** @var String */
76
+ private $documentPath;
77
+
78
+ // document title
79
+ /** @var String */
80
+ private $documentTitle;
81
+
82
+ // app name
83
+ /** @var String */
84
+ private $appName;
85
+
86
+ // app version
87
+ /** @var String */
88
+ private $appVersion;
89
+
90
+ // experiment id
91
+ /** @var String */
92
+ private $experimentID;
93
+
94
+ // experiment variant
95
+ /** @var String */
96
+ private $experimentVariant;
97
+
98
+ // content description
99
+ /** @var String */
100
+ private $contentDescription;
101
+
102
+ // link id
103
+ /** @var String */
104
+ private $linkID;
105
+
106
+ // custom dimensions
107
+ /** @var Array */
108
+ private $customDimension = array();
109
+
110
+ // custom metric
111
+ /** @var Array */
112
+ private $customMetric = array();
113
+
114
+ // productId
115
+ /** @var string */
116
+ private $productId;
117
+
118
+ /**
119
+ * Get the transfer Paket from current Event
120
+ *
121
+ * @return array
122
+ */
123
+ abstract public function createPackage();
124
+
125
+ /**
126
+ * Returns the Paket for Event Tracking
127
+ *
128
+ * @return array
129
+ * @throws \Racecore\GATracking\Exception\MissingTrackingParameterException
130
+ * @deprecated
131
+ */
132
+ public function getPaket()
133
+ {
134
+ return $this->createPackage();
135
+ }
136
+
137
+ /**
138
+ * @return array
139
+ */
140
+ public function getPackage()
141
+ {
142
+ $package = array_merge($this->createPackage(), array(
143
+ // campaign
144
+ 'cn' => $this->getCampaignName(),
145
+ 'cs' => $this->getCampaignSource(),
146
+ 'cm' => $this->getCampaignMedium(),
147
+ 'ck' => $this->getCampaignKeyword(),
148
+ 'cc' => $this->getCampaignContent(),
149
+ 'ci' => $this->getCampaignID(),
150
+
151
+ // other
152
+ 'dr' => $this->getDocumentReferrer(),
153
+ 'gclid' => $this->getAdwordsID(),
154
+ 'dclid' => $this->getDisplayAdsID(),
155
+
156
+ // system info
157
+ 'sr' => $this->getScreenResolution(),
158
+ 'sd' => $this->getScreenColors(),
159
+ 'vp' => $this->getViewportSize(),
160
+ 'de' => $this->getDocumentEncoding(),
161
+ 'ul' => $this->getUserLanguage(),
162
+ 'je' => $this->getJavaEnabled(),
163
+ 'fl' => $this->getFlashVersion(),
164
+
165
+ // Content Information
166
+ 'dl' => $this->getDocumentLocation(),
167
+ 'dh' => $this->getDocumentHost(),
168
+ 'dp' => $this->getDocumentPath(),
169
+ 'dt' => $this->getDocumentTitle(),
170
+ 'cd' => $this->getContentDescription(),
171
+ 'linkid' => $this->getLinkID(),
172
+
173
+ // app tracking
174
+ 'an' => $this->getAppName(),
175
+ 'av' => $this->getAppVersion(),
176
+
177
+ // enhanced e-commerce
178
+
179
+
180
+
181
+ // content experiments
182
+ 'xid' => $this->getExperimentID(),
183
+ 'xvar' => $this->getExperimentVariant(),
184
+ ));
185
+
186
+ $package = $this->addCustomParameters($package);
187
+
188
+ // remove all unused
189
+ $package = array_filter($package, 'strlen');
190
+
191
+ return $package;
192
+ }
193
+
194
+ /**
195
+ * @param array $package
196
+ * @return array
197
+ */
198
+ private function addCustomParameters( Array $package )
199
+ {
200
+ // add custom metric params
201
+ foreach( $this->customMetric as $id => $value )
202
+ {
203
+ $package['cm' . (int) $id ] = $value;
204
+ }
205
+
206
+ // add custom dimension params
207
+ foreach( $this->customDimension as $id => $value )
208
+ {
209
+ $package['cd' . (int) $id ] = $value;
210
+ }
211
+
212
+ return $package;
213
+ }
214
+
215
+ /**
216
+ * @param null $id
217
+ * @param $value
218
+ */
219
+ public function setCustomDimension($id = null, $value)
220
+ {
221
+ $this->customDimension[$id] = $value;
222
+ }
223
+
224
+ /**
225
+ * @param null $id
226
+ * @param $value
227
+ */
228
+ public function setCustomMetric($id = null, $value)
229
+ {
230
+ $this->customMetric[$id] = $value;
231
+ }
232
+
233
+ /**
234
+ * @param String $contentDescription
235
+ */
236
+ public function setContentDescription($contentDescription)
237
+ {
238
+ $this->contentDescription = $contentDescription;
239
+ }
240
+
241
+ /**
242
+ * @return String
243
+ */
244
+ public function getContentDescription()
245
+ {
246
+ return $this->contentDescription;
247
+ }
248
+
249
+ /**
250
+ * @param String $linkID
251
+ */
252
+ public function setLinkID($linkID)
253
+ {
254
+ $this->linkID = $linkID;
255
+ }
256
+
257
+ /**
258
+ * @return String
259
+ */
260
+ public function getLinkID()
261
+ {
262
+ return $this->linkID;
263
+ }
264
+
265
+ /**
266
+ * @param String $adwordsID
267
+ */
268
+ public function setAdwordsID($adwordsID)
269
+ {
270
+ $this->adwordsID = $adwordsID;
271
+ }
272
+
273
+ /**
274
+ * @return String
275
+ */
276
+ public function getAdwordsID()
277
+ {
278
+ return $this->adwordsID;
279
+ }
280
+
281
+ /**
282
+ * @param String $appName
283
+ */
284
+ public function setAppName($appName)
285
+ {
286
+ $this->appName = $appName;
287
+ }
288
+
289
+ /**
290
+ * @return String
291
+ */
292
+ public function getAppName()
293
+ {
294
+ return $this->appName;
295
+ }
296
+
297
+ /**
298
+ * @param String $appVersion
299
+ */
300
+ public function setAppVersion($appVersion)
301
+ {
302
+ $this->appVersion = $appVersion;
303
+ }
304
+
305
+ /**
306
+ * @return String
307
+ */
308
+ public function getAppVersion()
309
+ {
310
+ return $this->appVersion;
311
+ }
312
+
313
+ /**
314
+ * @param String $campaignContent
315
+ */
316
+ public function setCampaignContent($campaignContent)
317
+ {
318
+ $this->campaignContent = $campaignContent;
319
+ }
320
+
321
+ /**
322
+ * @return String
323
+ */
324
+ public function getCampaignContent()
325
+ {
326
+ return $this->campaignContent;
327
+ }
328
+
329
+ /**
330
+ * @param String $campaignID
331
+ */
332
+ public function setCampaignID($campaignID)
333
+ {
334
+ $this->campaignID = $campaignID;
335
+ }
336
+
337
+ /**
338
+ * @return String
339
+ */
340
+ public function getCampaignID()
341
+ {
342
+ return $this->campaignID;
343
+ }
344
+
345
+ /**
346
+ * @param String $campaignKeyword
347
+ */
348
+ public function setCampaignKeyword($campaignKeyword)
349
+ {
350
+ $this->campaignKeyword = $campaignKeyword;
351
+ }
352
+
353
+ /**
354
+ * @deprecated Use setCampaignKeyword
355
+ * @param $campaignKeyword
356
+ */
357
+ public function setCampaignKeywords($campaignKeyword)
358
+ {
359
+ if( is_array($campaignKeyword) )
360
+ {
361
+ return $this->setCampaignKeyword(implode(',', $campaignKeyword));
362
+ }
363
+
364
+ $this->setCampaignKeyword($campaignKeyword);
365
+ }
366
+
367
+ /**
368
+ * @return Array
369
+ */
370
+ public function getCampaignKeyword()
371
+ {
372
+ return $this->campaignKeyword;
373
+ }
374
+
375
+ /**
376
+ * @param String $campaignMedium
377
+ */
378
+ public function setCampaignMedium($campaignMedium)
379
+ {
380
+ $this->campaignMedium = $campaignMedium;
381
+ }
382
+
383
+ /**
384
+ * @return String
385
+ */
386
+ public function getCampaignMedium()
387
+ {
388
+ return $this->campaignMedium;
389
+ }
390
+
391
+ /**
392
+ * @param String $campaignName
393
+ */
394
+ public function setCampaignName($campaignName)
395
+ {
396
+ $this->campaignName = $campaignName;
397
+ }
398
+
399
+ /**
400
+ * @return String
401
+ */
402
+ public function getCampaignName()
403
+ {
404
+ return $this->campaignName;
405
+ }
406
+
407
+ /**
408
+ * @param String $campaignSource
409
+ */
410
+ public function setCampaignSource($campaignSource)
411
+ {
412
+ $this->campaignSource = $campaignSource;
413
+ }
414
+
415
+ /**
416
+ * @return String
417
+ */
418
+ public function getCampaignSource()
419
+ {
420
+ return $this->campaignSource;
421
+ }
422
+
423
+ /**
424
+ * @param String $displayAdsID
425
+ */
426
+ public function setDisplayAdsID($displayAdsID)
427
+ {
428
+ $this->displayAdsID = $displayAdsID;
429
+ }
430
+
431
+ /**
432
+ * @return String
433
+ */
434
+ public function getDisplayAdsID()
435
+ {
436
+ return $this->displayAdsID;
437
+ }
438
+
439
+ /**
440
+ * @param String $documentEncoding
441
+ */
442
+ public function setDocumentEncoding($documentEncoding)
443
+ {
444
+ $this->documentEncoding = $documentEncoding;
445
+ }
446
+
447
+ /**
448
+ * @return String
449
+ */
450
+ public function getDocumentEncoding()
451
+ {
452
+ return $this->documentEncoding;
453
+ }
454
+
455
+ /**
456
+ * @param String $documentHost
457
+ */
458
+ public function setDocumentHost($documentHost)
459
+ {
460
+ $this->documentHost = $documentHost;
461
+ }
462
+
463
+ /**
464
+ * @return String
465
+ */
466
+ public function getDocumentHost()
467
+ {
468
+ return $this->documentHost;
469
+ }
470
+
471
+ /**
472
+ * @param String $documentLocation
473
+ */
474
+ public function setDocumentLocation($documentLocation)
475
+ {
476
+ $this->documentLocation = $documentLocation;
477
+ }
478
+
479
+ /**
480
+ * @return String
481
+ */
482
+ public function getDocumentLocation()
483
+ {
484
+ return $this->documentLocation;
485
+ }
486
+
487
+ /**
488
+ * @param String $documentPath
489
+ */
490
+ public function setDocumentPath($documentPath)
491
+ {
492
+ $this->documentPath = $documentPath;
493
+ }
494
+
495
+ /**
496
+ * @return String
497
+ */
498
+ public function getDocumentPath()
499
+ {
500
+ return $this->documentPath;
501
+ }
502
+
503
+ /**
504
+ * @param String $documentReferrer
505
+ */
506
+ public function setDocumentReferrer($documentReferrer)
507
+ {
508
+ $this->documentReferrer = $documentReferrer;
509
+ }
510
+
511
+ /**
512
+ * @return String
513
+ */
514
+ public function getDocumentReferrer()
515
+ {
516
+ return $this->documentReferrer;
517
+ }
518
+
519
+ /**
520
+ * @param String $documentTitle
521
+ */
522
+ public function setDocumentTitle($documentTitle)
523
+ {
524
+ $this->documentTitle = $documentTitle;
525
+ }
526
+
527
+ /**
528
+ * @return String
529
+ */
530
+ public function getDocumentTitle()
531
+ {
532
+ return $this->documentTitle;
533
+ }
534
+
535
+ /**
536
+ * @param String $experimentID
537
+ */
538
+ public function setExperimentID($experimentID)
539
+ {
540
+ $this->experimentID = $experimentID;
541
+ }
542
+
543
+ /**
544
+ * @return String
545
+ */
546
+ public function getExperimentID()
547
+ {
548
+ return $this->experimentID;
549
+ }
550
+
551
+ /**
552
+ * @param String $experimentVariant
553
+ */
554
+ public function setExperimentVariant($experimentVariant)
555
+ {
556
+ $this->experimentVariant = $experimentVariant;
557
+ }
558
+
559
+ /**
560
+ * @return String
561
+ */
562
+ public function getExperimentVariant()
563
+ {
564
+ return $this->experimentVariant;
565
+ }
566
+
567
+ /**
568
+ * @param String $flashVersion
569
+ */
570
+ public function setFlashVersion($flashVersion)
571
+ {
572
+ $this->flashVersion = $flashVersion;
573
+ }
574
+
575
+ /**
576
+ * @return String
577
+ */
578
+ public function getFlashVersion()
579
+ {
580
+ return $this->flashVersion;
581
+ }
582
+
583
+ /**
584
+ * @param boolean $javaEnabled
585
+ */
586
+ public function setJavaEnabled($javaEnabled)
587
+ {
588
+ $this->javaEnabled = (bool) $javaEnabled;
589
+ }
590
+
591
+ /**
592
+ * @return boolean
593
+ */
594
+ public function getJavaEnabled()
595
+ {
596
+ if( $this->javaEnabled === null ){
597
+ return null;
598
+ }
599
+
600
+ return $this->javaEnabled ? '1' : '0';
601
+ }
602
+
603
+ /**
604
+ * @param String $screenColors
605
+ */
606
+ public function setScreenColors($screenColors)
607
+ {
608
+ $this->screenColors = $screenColors;
609
+ }
610
+
611
+ /**
612
+ * @return String
613
+ */
614
+ public function getScreenColors()
615
+ {
616
+ return $this->screenColors;
617
+ }
618
+
619
+ /**
620
+ * @param $width
621
+ * @param $height
622
+ */
623
+ public function setScreenResolution($width, $height)
624
+ {
625
+ $this->screenResolution = $width . 'x' . $height;
626
+ }
627
+
628
+ /**
629
+ * @return String
630
+ */
631
+ public function getScreenResolution()
632
+ {
633
+ return $this->screenResolution;
634
+ }
635
+
636
+ /**
637
+ * @param String $userLanguage
638
+ */
639
+ public function setUserLanguage($userLanguage)
640
+ {
641
+ $this->userLanguage = $userLanguage;
642
+ }
643
+
644
+ /**
645
+ * @return String
646
+ */
647
+ public function getUserLanguage()
648
+ {
649
+ return $this->userLanguage;
650
+ }
651
+
652
+ /**
653
+ * @param $width
654
+ * @param $height
655
+ */
656
+ public function setViewportSize($width, $height)
657
+ {
658
+ $this->viewportSize = $width . 'x' . $height;
659
+ }
660
+
661
+ /**
662
+ * @return String
663
+ */
664
+ public function getViewportSize()
665
+ {
666
+ return $this->viewportSize;
667
+ }
668
+
669
+ /**
670
+ * @param string $productId
671
+ */
672
+ public function setProductId($productId)
673
+ {
674
+ $this->productId = $productId;
675
+ }
676
+
677
+ /**
678
+ * @return string
679
+ */
680
+ public function getProductId()
681
+ {
682
+ return $this->productId;
683
+ }
684
+
685
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/App/Event.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking\App;
4
 
5
  use Racecore\GATracking\Tracking\Event as DefaultEvent;
@@ -22,4 +21,4 @@ use Racecore\GATracking\Tracking\Event as DefaultEvent;
22
  */
23
  class Event extends DefaultEvent
24
  {
25
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking\App;
3
 
4
  use Racecore\GATracking\Tracking\Event as DefaultEvent;
21
  */
22
  class Event extends DefaultEvent
23
  {
24
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/App/Screen.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking\App;
4
 
5
  use Racecore\GATracking\Tracking\AbstractTracking;
@@ -33,4 +32,4 @@ class Screen extends AbstractTracking
33
  't' => 'appview',
34
  );
35
  }
36
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking\App;
3
 
4
  use Racecore\GATracking\Tracking\AbstractTracking;
32
  't' => 'appview',
33
  );
34
  }
35
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/Ecommerce/Item.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking\Ecommerce;
4
 
5
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
@@ -32,6 +31,15 @@ class Item extends AbstractTracking
32
  private $category = '';
33
  private $currency = '';
34
 
 
 
 
 
 
 
 
 
 
35
  /**
36
  * Set the Transaction ID
37
  *
@@ -192,11 +200,13 @@ class Item extends AbstractTracking
192
  */
193
  public function createPackage()
194
  {
195
- if (!$this->getTransactionID()) {
 
196
  throw new MissingTrackingParameterException('transaction id is missing');
197
  }
198
 
199
- if (!$this->getName()) {
 
200
  throw new MissingTrackingParameterException('item name is missing');
201
  }
202
 
@@ -211,4 +221,5 @@ class Item extends AbstractTracking
211
  'cu' => $this->getCurrency()
212
  );
213
  }
214
- }
 
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking\Ecommerce;
3
 
4
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
31
  private $category = '';
32
  private $currency = '';
33
 
34
+ /**
35
+ * @param $host
36
+ * @deprecated
37
+ */
38
+ public function setTransactionHost( $host )
39
+ {
40
+ return $this->setDocumentHost( $host );
41
+ }
42
+
43
  /**
44
  * Set the Transaction ID
45
  *
200
  */
201
  public function createPackage()
202
  {
203
+ if( !$this->getTransactionID() )
204
+ {
205
  throw new MissingTrackingParameterException('transaction id is missing');
206
  }
207
 
208
+ if( !$this->getName() )
209
+ {
210
  throw new MissingTrackingParameterException('item name is missing');
211
  }
212
 
221
  'cu' => $this->getCurrency()
222
  );
223
  }
224
+
225
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/Ecommerce/Transaction.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking\Ecommerce;
4
 
5
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
@@ -35,9 +34,9 @@ class Transaction extends AbstractTracking
35
  * @param $host
36
  * @deprecated
37
  */
38
- public function setTransactionHost($host)
39
  {
40
- return $this->setDocumentHost($host);
41
  }
42
 
43
  /**
@@ -47,6 +46,7 @@ class Transaction extends AbstractTracking
47
  */
48
  public function setID($id)
49
  {
 
50
  $this->id = $id;
51
  }
52
 
@@ -175,7 +175,8 @@ class Transaction extends AbstractTracking
175
  */
176
  public function createPackage()
177
  {
178
- if (!$this->getID()) {
 
179
  throw new MissingTrackingParameterException('transaction id is missing');
180
  }
181
 
@@ -189,4 +190,5 @@ class Transaction extends AbstractTracking
189
  'cu' => $this->getCurrency()
190
  );
191
  }
192
- }
 
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking\Ecommerce;
3
 
4
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
34
  * @param $host
35
  * @deprecated
36
  */
37
+ public function setTransactionHost( $host )
38
  {
39
+ return $this->setDocumentHost( $host );
40
  }
41
 
42
  /**
46
  */
47
  public function setID($id)
48
  {
49
+
50
  $this->id = $id;
51
  }
52
 
175
  */
176
  public function createPackage()
177
  {
178
+ if( !$this->getID() )
179
+ {
180
  throw new MissingTrackingParameterException('transaction id is missing');
181
  }
182
 
190
  'cu' => $this->getCurrency()
191
  );
192
  }
193
+
194
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/Event.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking;
4
 
5
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
@@ -146,4 +145,4 @@ class Event extends AbstractTracking
146
  'ev' => $this->getEventValue()
147
  );
148
  }
149
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking;
3
 
4
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
145
  'ev' => $this->getEventValue()
146
  );
147
  }
148
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/Exception.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking;
4
 
5
  /**
@@ -83,4 +82,4 @@ class Exception extends AbstractTracking
83
  'exf' => ( $this->getExceptionFatal() ? '1' : '0' )
84
  );
85
  }
86
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking;
3
 
4
  /**
82
  'exf' => ( $this->getExceptionFatal() ? '1' : '0' )
83
  );
84
  }
85
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/Page.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking;
4
 
5
  /**
@@ -31,4 +30,4 @@ class Page extends AbstractTracking
31
  't' => 'pageview',
32
  );
33
  }
34
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking;
3
 
4
  /**
30
  't' => 'pageview',
31
  );
32
  }
33
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/Social.php CHANGED
@@ -1,7 +1,5 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking;
4
-
5
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
6
 
7
  /**
@@ -124,4 +122,4 @@ class Social extends AbstractTracking
124
  'st' => $this->getSocialTarget()
125
  );
126
  }
127
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking;
 
3
  use Racecore\GATracking\Exception\MissingTrackingParameterException;
4
 
5
  /**
122
  'st' => $this->getSocialTarget()
123
  );
124
  }
125
+ }
includes/vendor/ga-mp/src/Racecore/GATracking/Tracking/User/Timing.php CHANGED
@@ -1,5 +1,4 @@
1
  <?php
2
-
3
  namespace Racecore\GATracking\Tracking\User;
4
 
5
  use Racecore\GATracking\Tracking\AbstractTracking;
@@ -248,4 +247,4 @@ class Timing extends AbstractTracking
248
  'srt' => $this->getBrowserServerResponseTime()
249
  );
250
  }
251
- }
1
  <?php
 
2
  namespace Racecore\GATracking\Tracking\User;
3
 
4
  use Racecore\GATracking\Tracking\AbstractTracking;
247
  'srt' => $this->getBrowserServerResponseTime()
248
  );
249
  }
250
+ }