If you take a look in /App_Config/Sitecore/FederatedExperienceManager/Sitecore.FXM.config
you can see all of the processors that are called for <tracking.triggerpageevent>
<tracking.triggerpageevent>
<!-- Run when a page event is triggered by the client javascript to record the event in the DMS in the current session. -->
<processor type="Sitecore.FXM.Pipelines.Tracking.TriggerPageEvent.RunInitializeTrackingContextProcessor, Sitecore.FXM" resolve="true" />
<processor type="Sitecore.FXM.Pipelines.Tracking.TriggerPageEvent.ResolveCurrentPageContext, Sitecore.FXM" />
<processor type="Sitecore.FXM.Pipelines.Tracking.TriggerPageEvent.TriggerEventsProcessor, Sitecore.FXM" resolve="true" />
<processor type="Sitecore.FXM.Pipelines.Tracking.AfterEvent.CleanupAnalyticsCookieInResponseProcessor, Sitecore.FXM" resolve="true" />
</tracking.triggerpageevent>
You could create your own custom processor which extends sitecore's TriggerEventProcessor and overwrite the TriggerPageEvent. Use dotpeek for example to see the existing implementation of Sitecore.FXM.Pipelines.Tracking.TriggerPageEvent.TriggerEventsProcessor. Make sure to also register the custom processor class in the config file by using patching.
A similar approach can be seen for an older sitecore version https://reyrahadian.com/2016/07/26/sitecore-8-how-to-update-contact-through-fxm-api/