Skip to content

Instantly share code, notes, and snippets.

David Knipe davidknipe

Block or report user

Report or block davidknipe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View OrderEventsInit.cs
using EPiServer.Commerce.Order;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
namespace Foundation._EuromonitorExample
{
[InitializableModule]
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
public class OrderEventsInit : IInitializableModule
{
@davidknipe
davidknipe / CreateGetaCategoriesFromEpiserverCategoriesJob.cs
Created Oct 10, 2019
Create Geta Categories based on existing Episerver category structure
View CreateGetaCategoriesFromEpiserverCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
using Geta.EpiCategories.Extensions;
@davidknipe
davidknipe / MigrateContentToGetaCategoriesJob.cs
Last active Oct 13, 2019
Migrates content to use Geta Categories. Note will only migrate categories that exist in the Geta Categories structure.
View MigrateContentToGetaCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.Security;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
@davidknipe
davidknipe / PostClickInterceptor.cs
Last active Aug 6, 2019
Episerver tracking data interceptor to create Episerver Campaign post clicks from Episerver Insight tracking events
View PostClickInterceptor.cs
using System.Configuration;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Hosting;
using Episerver.Marketing.Common.Helpers;
using EPiServer.ServiceLocation;
using EPiServer.Tracking.Commerce.Data;
using EPiServer.Tracking.Core;
using EPiServer.Tracking.PageView;
View TrackEmailClick.cs
public static void TrackEmailClick(HttpContextBase httpContext, EPiServer.Tracking.Core.ITrackingService trackingService)
{
try
{
var email = GetCurrentUserEmail();
// If you know the users name and/or additional information
// like company name it's also possible to associate here
var userData = new UserData() { Name = email, Email = email };
var trackingData = new TrackingData<object>
{
@davidknipe
davidknipe / index.js
Last active Jun 19, 2018
Alexa skill for Episerver Music Festival to show of the Content Delivery API
View index.js
'use strict';
// --------------- Helpers that build all of the responses -----------------------
var http = require('http');
var axios = require('axios');
var striptags = require('striptags');
function buildSpeechletResponse(title, output, repromptText, shouldEndSession) {
return {
@davidknipe
davidknipe / MigrateDynamicContentToBlocks.cs
Created Apr 11, 2018
Migrate Episerver Dynamic content to Episerver blocks
View MigrateDynamicContentToBlocks.cs
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.IO;
using david_tec.Models.Blocks;
using david_tec.Models.Pages;
using EPi.Blog.Templates.PlugIn;
using EPiServer;
using EPiServer.Core;
using EPiServer.Core.Html.StringParsing;
View CustomScopeInterceptor.cs
using EPiServer.ServiceLocation;
using EPiServer.Tracking.Core;
namespace InsightScopes.Business.ChangeScope
{
[ServiceConfiguration(ServiceType = typeof(ITrackingDataInterceptor), Lifecycle = ServiceInstanceScope.Singleton)]
public class CustomScopeInterceptor : ITrackingDataInterceptor
{
public int SortOrder => int.MaxValue; // Ensure the interceptor fires last
@davidknipe
davidknipe / InsightCommandLine.cs
Last active Oct 12, 2018
Example of using the Episerver Profile store API
View InsightCommandLine.cs
using Newtonsoft.Json.Linq;
using RestSharp;
namespace InsightClient
{
class Program
{
private static string deviceId = "<deviceid>"; // retrive from _madid cookie value
private static string apiRootUrl = "<apiRootUrl>"; // get from Insight / Profile store developer portal
private static string subscriptionKey = "<subscriptionKey>"; // get from Insight / Profile store developer portal
View TrackingExample.cs
using System.Web;
using EPiServer.Core;
using EPiServer.Tracking.Core;
namespace AlloyDemoKit.Business.Insight
{
public class TrackingExample
{
private readonly ITrackingService _trackingService;
private readonly HttpContextBase _httpContextBase;
You can’t perform that action at this time.