Thursday, 23 February 2017

Script to flush Sitecore xDB

Many people have been talking about how to flush current visit to xDB without playing around the session timeout. Here is just a script ready for use when I need it.

<%@ Page Language="C#" AutoEventWireup="true" %>

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
    <title>Flush xDB</title>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
            if (Sitecore.Analytics.Tracker.Current != null)

                Response.Write("xDB flushed.");

Save as a ASPX page and put it somewhere on the site and browse to it to flush current visit into xDB.

No comments:

Post a Comment