Skip to content

Commit

Permalink
Merge pull request #5 from andrextor/Fix/should-track-method
Browse files Browse the repository at this point in the history
fix: `shouldTrackEvents` method
  • Loading branch information
eduarguz authored Aug 5, 2024
2 parents e742ac5 + fe8fd28 commit 0b1afed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.1] - 2024-08-05

### Changed

- Fix `shouldTrackEvents` method. Now the `defaultPayload` and `Payload` are merged before sending to the validation `shouldTrack`.

## [1.1.0] - 2024-08-02

### Added
Expand Down
4 changes: 3 additions & 1 deletion src/Trackers/MixpanelTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ public function track(string $label, array $payload = []): void
return;
}

$payload = array_merge($this->defaultPayload, $payload);

if ($this->shouldTrack($label, $payload)) {
$this->mixpanel->track($label, array_merge($this->defaultPayload, $payload));
$this->mixpanel->track($label, $payload);
}
}

Expand Down

0 comments on commit 0b1afed

Please sign in to comment.