How to disable Sitecore Analytics entirely
Asked Answered
F

3

6

We are experiencing cpu problems on our production servers. After profiling with the jetbrains cpu profiler, we have noticed that some functions in the assembly Sitecore.Analytics were executed.

This is somewhat strange because we have disabled all analytics related configuration in de config files.

After looking into the /sitecore/admin/showconfig.aspx we noticed that there are still a lot of Sitecore.Analytics related configurations in this config while these are deactivated in our config files.

For example

In the file /App_Config/Include/EventHandlers.config the configuration looks like this:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
 <sitecore>
   <events timingLevel="custom">
   </events>
 </sitecore>
</configuration>

When looking into the showconfig.aspx it looks something like this:

<events timingLevel="custom">
<event name="forms:save"/>
<event name="item:saved">
            <handler type="Sitecore.Analytics.Data.Items.ItemEventHandler, Sitecore.Analytics" method="OnItemSaved"/>
            <handler type="Sitecore.Analytics.Automation.Data.Items.ItemEventHandler, Sitecore.Automation.MarketingAutomation" method="OnAutomationStateChanged"/>
        </event>
        <event name="item:deleted">
            <handler type="Sitecore.Analytics.Automation.Data.Items.ItemEventHandler, Sitecore.Automation.MarketingAutomation" method="OnAutomationStateChanged"/>
        </event>
        <event name="media:request">
            <handler type="Sitecore.Analytics.Media.MediaRequestEventHandler, Sitecore.Analytics" method="OnMediaRequest"/>
        </event>
</events>

Does anyone has an idea why these are still returning in the showconfig.aspx? Is there a way to fully delete/disable the sitecore analytics module?

Froehlich answered 19/6, 2014 at 7:18 Comment(1)
Just an FYI, there are some Sitecore features which rely on Analytics being active. One that immediately comes to mind is the IP geo-coding. So if you are using that feature to drive geographic-based content, it will fail when Analytics is disabled.Trek
E
7

Yes. Rename the 3 configuration files for Sitecore.Analytics in your /App_Config/Include directory to something other than *.config

The 3 files are:

  • Sitecore.Analytics.config
  • Sitecore.Analytics.ExcludeRobots.config
  • Sitecore.Analytics.RobotDetection.config

(could vary a little bit by version, but they all start with Sitecore.Analytics).

Rename them to something like:

  • Sitecore.Analytics.config.disabled
  • Sitecore.Analytics.ExcludeRobots.config.disabled
  • Sitecore.Analytics.RobotDetection.config.disabled
Electrodynamometer answered 20/6, 2014 at 9:53 Comment(0)
V
2

(could vary a little bit by version, but they all start with Sitecore.Analytics).

Until sitecore version 72, there are only 3 files with Sitecore.Analytics prefix. In version 75, there are 17 and in version 8 there are 20 config files with Sitecore.Analytics prefix.

I used to confirm with sitecore support that you can change the setting of Analytics.Enabled in Sitecore.Analytics.config will disable Analytics

<setting name="Analytics.Enabled" value="false" />

Or only rename one file Sitecore.Analytics.config which contain this setting.

Varick answered 16/1, 2015 at 15:3 Comment(1)
Note that (for Sitecore 8.0 rev. 150121) the experience analytics module doesn't take this setting into account: ExperienceAnalytics Reduce subsystem is not initialized as Analytics is disabled shows up in log file, but its SegmentInitializer throws an exception a few lines later. Also accessing the Sitecore Launchpad tries to get aggregation stats through a remote call, which cause another exception.Okie
P
1

Did you try to User WFFM ? There also analytics part: Sitecore.WFFM.Analytics.config

and disabling it causes this fault:

22992 14:49:10 WARN Value cannot be null. Parameter name: owner Exception: System.ArgumentNullException Message: Value cannot be null. Parameter name: owner Source: Sitecore.Kernel at Sitecore.Diagnostics.Assert.ArgumentNotNull(Object argument, String argumentName) at Sitecore.Diagnostics.Log.Warn(String message, Object owner) at Sitecore.WFFM.Core.Extensions.Warn.IsNull(Object obj, String name) at Sitecore.WFFM.Analytics.AnalyticsTracker.get_SessionId() at Sitecore.Form.Core.FormDataHandler.ExecuteSaveActions(ID formId, ControlResult[] fields, ActionDefinition[] actions) at Sitecore.Form.Core.FormDataHandler.ProcessData(SimpleForm form, ControlResult[] fields, ActionDefinition[] actions)

So it cannot be disabled.

Puffin answered 7/7, 2015 at 12:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.