Skip to content

Instantly share code, notes, and snippets.

View LucGosso's full-sized avatar
😀

Luc Gosso LucGosso

😀
View GitHub Profile
@LucGosso
LucGosso / GetPopularItemsFromAnalyticsJob.cs
Last active May 10, 2022 09:08
Google Analytics Service v4 C# .netframework example with Episerver. Blogpost https://devblog.gosso.se/?p=766
using Gosso.Web.Business.Services;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.ServiceLocation;
//Episerver Schedual job to update the cache with fresh data from Google Analytics
namespace Gosso.Web.Business.Jobs
{
[ScheduledPlugIn(DisplayName = "Get Statistics from Analytics (api v4)",
@LucGosso
LucGosso / tracking.js
Last active April 4, 2023 18:42
Google analytics Gist tracking mailto, download, external links and Episerver Form. https://devblog.gosso.se/?p=1232
function epiGat(settings) {
if (settings.downloads || settings.external || settings.mailto) {
var isinternal = new RegExp('^' + window.location.protocol + '\/\/' + window.location.host, 'i');
function addEvent(obj, type, fn) {
if (obj.addEventListener)
obj.addEventListener(type, fn, false);
else if (obj.attachEvent) {
obj['e' + type + fn] = fn;
obj[type + fn] = function () { obj['e' + type + fn](window.event); }
using EPiServer;
using EPiServer.Cms.UI.AspNetIdentity;
using EPiServer.Core;
using EPiServer.Logging;
using EPiServer.Notification;
using EPiServer.ServiceLocation;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;