This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST"> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Replace xxx with your values as necessary. | |
function googleAnalyticsReporting() { | |
projectId = "xxx"; | |
datasetId = "xxx"; | |
tableId = 'xxx'; | |
data = []; | |
yesterday = new Date(); | |
yesterday.setDate(yesterday.getDate() - 1); | |
yesterday = Utilities.formatDate(yesterday, 'UTC', "yyyy-MM-dd"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
$(document).ready(function() { | |
if (typeof zE != 'undefined') { | |
zE(function() { | |
$zopim(function() { | |
$zopim.livechat.setOnConnected(function() { | |
//console.log("zendesk chat connected"); | |
//trigger(); | |
_satellite.track('zendeskChatConnected'); | |
dataLayer.push({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_satellite.logger.log("CHECKING JQUERY", $, jQuery); | |
$(document).ready(function() { | |
_satellite.logger.log("INSTALLING HANDLER"); | |
$(document).ajaxSuccess(function(event, xhr, settings) { | |
_satellite.logger.log("FIRING HANDLER", event, xhr, settings); | |
var alreadyRun = false; | |
console.log("already run false"); | |
if ((settings.url.indexOf("/loadResults.jsp") > -1) && (alreadyRun = false)); { | |
_satellite.logger.log("HANDLER CAUGHT loadResults.jsp", event, xhr, settings); | |
alreadyRun = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
window.drift.on('ready',function(api){ | |
window.drift.on('message:sent',function(event){ | |
{ | |
dataLayer.push({ | |
'event': 'driftInteraction', | |
'eventCategory': 'drift', | |
'eventAction': 'message sent', | |
'eventLabel': 'drift>message sent conversation id: ' + event.conversationId | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Adobe Analytics|DTM] Previous pageName | |
If you want to save the previous pageName via DTM without a Plugin (getPreviousValue), you can use Session Storage. Two Pageload Rules are needed. | |
First PLR: | |
- Trigger Rule at “DOM Ready” | |
- Rule Condition: Path “.*” (regex enabled) | |
- Custom Code “None-Sequential Javascript”: | |
if(typeof(Storage) != "undefined") { | |
if (typeof(s) !== "undefined") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(){ | |
// Set up the parameters and variables | |
var sheetName = '<name>'; // The name of the sheet (not the Spreadsheet) we want to write the data e.g Sheet1 | |
var tableId = '<table id>'; // The id of the view to query the data from e.g ga:123456 | |
var startDate = 'yyyy-MM-dd'; // The start date of the query with the appropriate format e.g 2018-04-01 (1 April 2018) | |
var endDate = 'yyyy-MM-dd'; // The end date of the query with the appropriate format e.g 2018-04-30 (30 April 2018) | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = spreadsheet.getSheetByName(sheetName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr) | |
library(rjson) | |
url <-'https://driftapi.com/conversations/52662097/messages' | |
token <-'AQ14yXgTM934cMjNEGfa6epBDU6TpCIY' | |
query <- GET(url, add_headers('Authorization' = paste("bearer", token))) | |
http_status(query) | |
df <-fromJSON(content(query,type='text',encoding= 'UTF-8')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var isDownloadLink = function(lnk) { | |
var isDownload = false; | |
if (typeof lnk.href !== 'undefined') { | |
var fileTypes = window.s.linkDownloadFileTypes.split(','); | |
var href = lnk.href.toLowerCase(); | |
for (var k = 0; k < fileTypes.length; k++) { | |
if (href.indexOf(fileTypes[k].trim()) > -1) { | |
isDownload = true; | |
break; | |
} |