Skip to content

Instantly share code, notes, and snippets.

@agehlot
agehlot / Core.Foundation.Aggregation.config
Created March 13, 2021 13:04
Sitecore Aggregation pipeline processor config
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or Processing">
<pipelines>
<group groupName="analytics.aggregation">
<pipelines>
<interactions>
<processor type="Core.Foundation.Analytics.Collection.Pipelines.Aggregation.PageEventProcessor, Core.Foundation.Analytics.Collection" />
</interactions>
</pipelines>
@agehlot
agehlot / PageEventProcessor.cs
Last active March 13, 2021 14:35
Sitecore Aggregation pipeline processor code
using Microsoft.Extensions.DependencyInjection;
using Sitecore.Analytics.Aggregation.Pipeline;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.DependencyInjection;
using Sitecore.Diagnostics;
using Sitecore.XConnect.Collection.Model;
using System;
using System.Collections.Generic;
using System.Linq;
@agehlot
agehlot / AzureKeyVaultCacheHelper.cs
Created March 13, 2021 18:25
Helper methods for getting a key from Azure Key Vault
using Microsoft.Azure.KeyVault;
using Microsoft.Azure.KeyVault.Models;
using Microsoft.Identity.Client;
using Sitecore.Diagnostics;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Web.Configuration;
namespace Core.Foundation.AzureKeyVault.Helper
{
@agehlot
agehlot / PushNotificationService.cs
Created March 13, 2021 18:33
Firebase push notification service
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Web.Script.Serialization;
namespace Core.Foundation.Notification.Services
{
[Service(typeof(IPushNotificationService))]
@agehlot
agehlot / HashHelper.cs
Created March 13, 2021 18:35
Helper class to generate one way hash value of given parameter
// ***********************************************************************
// Assembly : Core.Foundation.SitecoreExtensions
// Author : agehlot
// Created : 10-24-2020
//
// Last Modified By : agehlot
// Last Modified On : 10-24-2020
// ***********************************************************************
// <copyright file="HashHelper.cs" company="">
// Copyright © 2019
@agehlot
agehlot / TrackingFieldHelper.cs
Created March 14, 2021 00:43
Collection of helper methods for Sitecore Tracking field
using Sitecore.Analytics.Data;
using Sitecore.Analytics.Data.Items;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.SecurityModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
@agehlot
agehlot / MarketingActivityHelper.cs
Created March 14, 2021 00:45
Triggering a Sitecore goal programmatically
namespace Core.Foundation.SitecoreExtensions.Helpers
{
/// <summary>
/// Class MarketingActivityHelper.
/// </summary>
public class MarketingActivityHelper
{
/// <summary>
/// Triggers the goal.
/// </summary>
@agehlot
agehlot / MemoryCache.cs
Last active March 14, 2021 04:21
Helper methods for managing cache using MemoryCache
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Threading;
using System.Web;
namespace Core.Foundation.Caching.CustomCaching
{
public static class MemoryCache
@agehlot
agehlot / CustomCache.cs
Created March 14, 2021 04:22
Sitecore custom cache class
using Sitecore.Caching;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Core.Foundation.Caching.CustomCaching
{
/// <summary>
@agehlot
agehlot / boxever-test-Index.html
Created July 11, 2021 15:28
This is the sample html test page to verify how new user is being created in the Boxever? how new event can be trigger in the Boxever. Initially my event were not getting reflected there in Boxever user event section but later, when commented out pos value, it started working.
<html>
<head>
<script type="text/javascript">
// Define the Boxever queue
var _boxeverq = _boxeverq || [];
// Define the Boxever settings
var _boxever_settings = {
client_key: '<Replace your Clint_Key>', // Replace with your client key
target: 'https://api.boxever.com/v1.2', // Replace with your API target endpoint specific to your data center region