I want to exclude my site's tracking code(s) from my local development templates, but I've a hard time writing the conditional.

I am using an embedded template which contains the doctype, metadata and also has an embed for the css template.

Could you write a conditional within this embedded template which checks if there is a file (snipped or embedded template) called "analysis"?

  • Need more information. Tracking codes - is this EE page tracking or Google Analytics (or similar)? What's a snipped template - do you mean snippet variable? Please confirm that the file you're checking for is a template file (which could surely be database too) or another external file unrelated to EE. Commented May 13, 2013 at 8:28

1 Answer 1


using my bootstrapped config file http://d.pr/n/tTcT I create a global variable for the particular environment I'm working in and then in my template code I do

{if gv_env == 'prod'}
my analytics tracking code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.