can_track() ) { return; } $user = wp_get_current_user(); $this->identify_user( $user ); $properties = $this->get_default_event_properties(); $properties['nudge_location'] = $location; $this->mixpanel->track( 'Upgrade nudge banner shown', $properties ); } /** * Track a nudge CTA click event when a free user clicks the "Upgrade to Pro" button. * * @param string $storage_slug The storage slug the user tried to upgrade from. * * @return void */ public function track_nudge_click( string $storage_slug ): void { if ( ! $this->can_track() ) { return; } $user = wp_get_current_user(); $this->identify_user( $user ); $properties = $this->get_default_event_properties(); $properties['storage'] = $storage_slug; $this->mixpanel->track( 'Upgrade nudge banner clicked', $properties ); } /** * Track a locked option click event when a free user attempts to select a PRO-only storage. * * @param string $storage_slug The storage slug the user attempted to select. * * @return void */ public function track_locked_option_click( string $storage_slug ): void { if ( ! $this->can_track() ) { return; } $user = wp_get_current_user(); $this->identify_user( $user ); $properties = $this->get_default_event_properties(); $properties['storage'] = $storage_slug; $this->mixpanel->track( 'Locked storage option clicked', $properties ); } }