diff --git a/lib/Analytics/Consumer/Fornax.php b/lib/Analytics/Consumer/Fornax.php index 1aafff7..e93ea1b 100644 --- a/lib/Analytics/Consumer/Fornax.php +++ b/lib/Analytics/Consumer/Fornax.php @@ -59,6 +59,17 @@ public function track($user_id, $event, $properties, $context, $timestamp) { $event = 'MissingDomain.' . ltrim($event, '.'); } + if (!is_array($properties)) { + // if a non-array was passed, create an array out of it + if (!empty($properties)) { + $properties = array( + 'message' => $properties + ); + } else { + $properties = array(); + } + } + if (isset($this->options['defaultProperties'])) { $properties = array_merge($properties, $this->options['defaultProperties']); }