| @@ -97,8 +97,20 @@ | ||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | + * Forced tracking. | |
| 102 | + * | |
| 103 | + * @param string $event The event to track. | |
| 104 | + * @param array $data The data associated with the event. | |
| 105 | + * | |
| 106 | + * @return void | |
| 107 | + */ | |
| 108 | + public function forced_track( $event, $data ) { | |
| 109 | + $this->tracker()->track( $event, $data ); | |
| 110 | + } | |
| 111 | + | |
| 112 | + /** | |
| 101 | 113 | * Save tracking state. |
| 102 | 114 | * |
| 103 | 115 | * @param Request $request Request object. |
| 104 | 116 | * |
| @@ -108,9 +120,9 @@ | ||
| 108 | 120 | public function track_feature_handler( Request $request ): Response { |
| 109 | 121 | // Forced tracking. |
| 110 | 122 | $data = $request->get_data(); |
| 111 | 123 | if ( isset( $data['force'] ) ) { |
| 112 | - $this->tracker()->track( $data['event'], $data['data'] ); | |
| 124 | + $this->forced_track( $data['event'], $data['data'] ); | |
| 113 | 125 | |
| 114 | 126 | return new Response( true, array() ); |
| 115 | 127 | } |
| 116 | 128 | // Otherwise it's a normal process. |