- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
static web page, multiple environment (dev/staging/prod)

static web page, multiple environment (dev/staging/prod)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Hi there,
our web site index.html is static, and I was wondering how can I enable working with different optimizely projects, each loaded in a different environment (dev/staging/prod).
e.g. for dev, I'd like the html to load the optimizely snippet that belongs to the sandbox project
<head>
<script src="https://cdn.optimizely.com/js/111111111.js"></script>"
</head>
wheares for prod environment, I would need
<head>
<script src="https://cdn.optimizely.com/js/2222222.js"></script>"
</head>
Other analytics tools that I've used with provide a different token per environment, but here it seems that for the static HTML page (which I have), I need some other manipulation.
any help would be appreciated,
Idan
Solved! Go to Solution.
Re: static web page, multiple environment (dev/staging/prod)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
I'm not positive that I understand your question. Each Optimizely project will have a unique snippet, and typically people will create a separate project for each environment. The experiments associated with a given project will only run on pages that include that project's snippet, so all you need to do to use different projects with different environments is to place the appropriate snippet in the head of the matching environment's code.
Unless you're saying there is some reason you can't do this?
Re: static web page, multiple environment (dev/staging/prod)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
Yes, the reason I cannot do that, is that I strive to keep the same static code regardless of the environment.
meaning, index.html should be the same static file in dev/QA/Prod. it may execute differnt logic, but the hard coded <script src=""> that optimizely enforces, cannot be manipulated.

Re: static web page, multiple environment (dev/staging/prod)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report