Skip to content

mida-so/mida-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Mida Frontend Script (Self Hosted CDN)

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.

Getting Started

To start using the self-hosted CDN scripts, follow these steps:

  1. Clone this repository to your local machine or download the ZIP file.

  2. Upload the contents of the /dist folder to your own CDN or hosting service. Make sure to preserve the folder structure (/js and /css).

  3. Update your HTML files to include the necessary configuration and script tags.

Configuration

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.

Mandatory Configuration

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>

Custom Folder Structure

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>

File Structure

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.

Support

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!

About

Self-hosted frontend script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published