Any A/B testing method for Javascript file that is embedded on third-party domains? [closed]

I’m developing a web product that will be embedded on third-party websites (across domains).
The product is served as a JS file and enables a widget to pop up at websites.
I’d like to improve the effect of service by testing widget appearance across domains.

So the question is, what would be a possible solution for A/B testing for scripts that is embedded across domains?

Though Google Optimize is a great A/B testing tool, it’s not applicable for third-party websites.
I think widget-like services are getting more and more common (such as Intercom and Zendesk), so there would be some good solutions. (Or these players individually implement A/B testing for themselves?)

Any good ideas?