Skip to content

Commit

Permalink
Merge pull request #5 from kyranb/patch-1
Browse files Browse the repository at this point in the history
Fix 'track' calls not working with empty $properties
  • Loading branch information
Iago Melanias authored Mar 27, 2020
2 parents 5a4076c + ac6cb6c commit 845adc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Heap/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ public function track($event, $identity, $properties = array())
$data = array(
'app_id' => $this->appId,
'event' => $event,
'properties' => $properties,
'identity' => $identity,
);

if(!empty($properties)){
$data['properties'] = $properties;
}

return $this->request->call('POST', '/track', $data);
}
Expand All @@ -83,4 +86,4 @@ public function addUserProperties($identity, $properties = array())

return $this->request->call('POST', '/add_user_properties', $data);
}
}
}

0 comments on commit 845adc5

Please sign in to comment.