Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Tracking Code to Alloy Sample Site

Vote:
 

Hi,

Sorry, i'm sure this is a simple question but I just can't get it to work. I've never used EpiServer before and am evaluating it. I need to add the following tracking code () to the alloy test site so that each page is tracked. I tried adding it to a file and adding the following into c:\EPIServer\Sites\MyEpiServerSite\module.config but it doesn't appear in the page source.



Nothing i've tried seems to work. Any help would be really appreciated!

Thanks,

Mark

#155002
Sep 06, 2016 18:40
Vote:
 

Why don't you just add it to the layout file?

#155013
Sep 07, 2016 7:44
Vote:
 

I usually do like Henrik and then add one or two appsettings to turn the script on and off and set the id (if needed)

#155014
Sep 07, 2016 8:06
Vote:
 

You should also propably wrap it with this so it won't be executed when the page are in edit mode

@if (!PageEditing.PageIsInEditMode)
    {
......................................
}
#155015
Sep 07, 2016 8:45
Vote:
 

Thanks guys, appreciate it

#155020
Sep 07, 2016 12:42
Vote:
 

And also probably you should not include them while developing locally, which makes another statement to the "if".

Which makes it perfect fit for conditional script rendering from FeatureSwitch library. :)

#155039
Sep 08, 2016 10:06
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.