US location installation instructions

This article contains legacy installation scripts. We're working on the article update.

To install Product Fruits into your application, when your company uses our US location, follow the standard installation guide. However, there are things you need to update

You have to set the productFruitsEnv global variable to us1 and the standard domain https://app.productfruits.com to https://app.us1.productfruits.com.

Standard JavaScript snippet changes

<script type="text/javascript">
	window.productFruitsEnv = 'us1';
 
	window.productFruitsUser = { username: '<<REPLACE>>' };
	(function(w,d,u,c,l){
        w.productFruits=w.productFruits||{};
        w.productFruits.language=l;w.productFruits.code=c;
        var a=d.getElementsByTagName('head')[0];
        var r=d.createElement('script');r.async=1;
        r.src=u+'?c='+c;
        a.appendChild(r);
	})(window,document,'https://app.us1.productfruits.com/static/script.js','xxxxxxxxx','HERE COMES THE LANGUAGE CODE'); // language = ISO 2 letter
</script>

React or NextJS changes

The change is quite simple. Add the environment prop and set it to us1.

<ProductFruits projectCode='xxx' language='en' {...userInfo} environment='us1' />