This repository contains the necessary files to self-host your own CDN scripts for the Mida A/B testing service. By self-hosting the CDN scripts, you have full control over the hosting and distribution of the required JavaScript and CSS files.
To start using the self-hosted CDN scripts, follow these steps:
-
Clone this repository to your local machine or download the ZIP file.
-
Upload the contents of the
/dist
folder to your own CDN or hosting service. Make sure to preserve the folder structure (/js
and/css
). -
Update your HTML files to include the necessary configuration and script tags.
To configure your self-hosted CDN scripts, you need to set the window.mdcdn
variable and include the appropriate script tag in your HTML files.
Add the following code snippet to your HTML files, replacing cdn.yourhostedurl.com
with the URL of your self-hosted CDN and YourProjectKeyHere
with your actual project key:
<script>
window.mdcdn = 'cdn.yourhostedurl.com'; // Default value: "cdn.mida.so"
</script>
<script type="text/javascript" async src="https://cdn.yourhostedurl.com/js/optimize.js?key=YourProjectKeyHere"></script>
If you prefer to separate the Mida CDN scripts into a separate folder instead of mixing them with your existing JavaScript and CSS files, you can create your own folder and update the window.mdcdn
path accordingly.
For example, if you want to use the folder structure https://cdn.yourhostedurl.com/mida/js/
and https://cdn.yourhostedurl.com/mida/css/
, update the configuration as follows:
<script>
window.mdcdn = 'cdn.yourhostedurl.com/mida'; // Without trailing slash
</script>
<script type="text/javascript" async src="https://cdn.yourhostedurl.com/mida/js/optimize.js?key=YourProjectKeyHere"></script>
The repository consists of the following folder structure:
/dist/
/js/
/css/
- The
/dist
folder contains the distribution files for the self-hosted CDN. - The
/js
folder contains the necessary JavaScript files. - The
/css
folder contains the necessary CSS files.
Make sure to include the appropriate files from the /js
and /css
folders in your HTML files, depending on your configuration.
If you encounter any issues or have questions regarding the self-hosted CDN scripts, please contact our support team at hello@mida.so.
We hope you find this self-hosted CDN solution useful for your A/B testing needs. Happy testing!