Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
DP-77 Add defaultContext for Fornax consumer
Browse files Browse the repository at this point in the history
Will merge context with defaultContext in that order.
  • Loading branch information
leahciMic committed May 15, 2014
1 parent f14e069 commit b37da7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Analytics/Consumer/Fornax.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down

0 comments on commit b37da7b

Please sign in to comment.