Try our conversational search powered by Generative AI!

Tracking Code to Alloy Sample Site



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!



Sep 06, 2016 18:40

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

Sep 07, 2016 7:44

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)

Sep 07, 2016 8:06

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

@if (!PageEditing.PageIsInEditMode)
Sep 07, 2016 8:45

Thanks guys, appreciate it

Sep 07, 2016 12:42

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. :)

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.