Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom Java Script Tag by environment


We are trying to add a custom piece of javascript tag into the wrapper header to be applied to all our pages.  The problem we are having is adding a unique tag per environment.  We followed the instructions here but were stopped in our tracks when we couldn't figure out what the "number" the name was supposed to be associated with.

Really all we are trying to do is apply a 2 line javascript tag to the wrapper header per environment.

Could someone help with this?

5 Replies 5

Hello, does anyone have any knowledge of this?


What are you trying to add is it something that displays in stage but not in prod or vis verse ? Not sure what you mean by tag or is this some tracking/analytics tag   

I have a wrapper this is in the header which only displays in stage as it looks up “what environment am i” if prod do this if stage do that? 


Checkout some of the stuff i've built using the platform:
Community l Ideation l Blog l Product Hubs l Check & Report l Service Status 

My latest Ideas: Vanity URL Manager l @mention Roles l  LSW Password Policy

Hi @isaac_dessert - 

Are you using the Wrapper in Studio? (found under Studio > Community Style > Wrapper > [Your skin])

If so, you won't necessarily need the custom content component code from the article you referenced. 

You can instead use something along the lines of:

<#if !config.getString('phase', '')?matches('stage')>
<script type="text/javascript" src="[YOUR CODE FILE]"></script>

in the Studio wrapper (e.g. the Hitbox) to use different code per environment 

Hope that helps!

Hey CarolineS,

This seems to be exactly what I'm looking for.  Is there a full article on this topic that I can reference for more reading material?



Hi Isaac,

Great, I'm glad that was helpful! This doc explains the wrapper: And if you scroll down to the comments you'll see some nice relevant example code.


Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.