Open a URL using Google Apps Script without requiring additional user interaction.
Code also on StackOverflow.
console.table(dataLayer.filter(v=>v.event=="eventTracking"),['label','action','value']) |
Open a URL using Google Apps Script without requiring additional user interaction.
Code also on StackOverflow.
/* | |
SIMPLEST USAGE: | |
Copy all this code and paste it in the console to see all the data layer's available data | |
in different formats, and learn about the data layer queue vs data layer state. | |
USAGE: | |
// See data layer state as nested objects. | |
datalayerGetAll( dataLayer ); |
This does not cover all aspects of setup; just the web pixel side. All this does is add an event_id to all FB pixels (arguably the most complex part of the clientside setup) without having to modify any pixels directly.
This code is for GTM, but would be trivial to modify code for use anywhere.
In GTM web container ...
event_id
= {{Facebook Event ID}}
.function onEdit(){ | |
const ss = SpreadsheetApp.getActive(); | |
const sheet = ss.getSheetByName('Table: MS OST'); | |
sheet.getRange(1,1).setValue( +new Date() ); | |
setCell_hyperlinkList( |
<script>(function(){ | |
/* | |
This script is an alternative to the 'Add JavaScript API support to all YouTube videos' | |
setting in GTM's YT trigger. GTM's YT trigger will not load the YT API if no videos are | |
present at page load (it does add the enablejsapi param to dynanmically inserted videos, | |
but it will not load the YT API js). This script, on the other hand, should work in all cases. | |
*/ | |
if( window.YT ) return; | |
<?php | |
if( IS_DEV_SITE ) { | |
//Disable RSS Feeds functions | |
add_action('do_feed', array( $this, 'disabler_kill_rss' ), 1); | |
add_action('do_feed_rdf', array( $this, 'disabler_kill_rss' ), 1); | |
add_action('do_feed_rss', array( $this, 'disabler_kill_rss' ), 1); | |
add_action('do_feed_rss2', array( $this, 'disabler_kill_rss' ), 1); | |
add_action('do_feed_atom', array( $this, 'disabler_kill_rss' ), 1); | |
if(function_exists('disabler_kill_rss')) { |
Useful for preventing PII from being tracked.
Usage:
page_location
={{Page URL (PII Stripped)}}.page
={{UA Pageview URL (PII Stripped)}} and location
={{Page URL (PII Stripped)}}./** | |
* @function onDomInsert - Listener for nodes inserted into DOM. | |
* Does NOT monitor when things are removed. | |
* Based on http://stackoverflow.com/a/14570614/445295 | |
* @param [DOMNode] el - Optional. The element to listen on. Defaults to document. | |
* @param [Function] cb - Callback. Called with inserted element as only arg. | |
*/ | |
var onDomInsert = (function(){ | |
'use strict'; | |
This is Hubspot template refinement code, meant to be applied standalone rather than customizing theme files. It can be used on specific pages, or site wide by adding under Settings > Website > Pages > Templates > Site header).
This code is used on info.seerinteractive.com, with an unmodified 'Atlas by Kalungi' theme.