Follow

Insert scripts on instance level

Table of Contents

 

Introduction

For hosting partners, we have replaced the ability to add a Google Analytics code with the ability to inject a custom piece of HTML into every page (e.g. Google Tag Manager). 

 

Configuration

Custom info can be changed via the config settings which can be found in: 

\inetpub\wwwroot\{tenant name}\{workspace folder}\Configs\NDAW.Html.Front.config

The setting is called "ExtraHtmlToInjectOnEveryPage". In order to set it in the config you need to XML encode the HTML snippet you want to be injected. Make sure to mention that if you want to inject a piece of javascript that it need to include the <script> tags in the setting.

<setting name="ExtraHtmlToInjectOnEveryPage" serializeAs="String">
<value>&lt;h1&gt;Hello world!&lt;/h1&gt;</value>
</setting>

To prevent the update of Workspace 365 to overrule this setting again, you need to add the following parameter to the Workspace 365 parameterfile:

AddTransform("ExtraHtmlToInjectOnEveryPage", @"CODE SNIPPET ENCODED");
The setting ""GoogleAnalyticsTrackingId" is removed. Hosting partners who want to keep using their existing Google Analytics can manually add the the new script "ExtraHtmlToInjectOnEveryPage".

Back to top