diff --git a/lib/Analytics/Consumer/Fornax.php b/lib/Analytics/Consumer/Fornax.php index e93ea1b..96e088c 100644 --- a/lib/Analytics/Consumer/Fornax.php +++ b/lib/Analytics/Consumer/Fornax.php @@ -140,6 +140,10 @@ private function write($body) { $body['anonymousId'] = $this->options['anonymousId']; } + if (isset($this->options['defaultContext']) && is_array($this->options['defaultContext'])) { + $body['context'] = array_merge($this->options['defaultContext'], $body['context']); + } + $content = json_encode($body); $content.= "\n";