Skip to content

Instantly share code, notes, and snippets.

View jason-engage's full-sized avatar

Jason Shaw jason-engage

  • Raw AI
View GitHub Profile
@LindaLawton
LindaLawton / Google Analytics PHP Sample ReadME
Last active November 19, 2020 11:26
Oauth example for PHP and the Google Analytics reporting api v4 with pagination.
For service account auth include:
require_once __DIR__ . '/ServiceAccount.php';
For Oauth2 include:
require_once __DIR__ . '/Oauth2Authentication.php';
Note: To reset the auth for oauth to just unset the sessions
@dfrdmn
dfrdmn / remarketing.liquid
Last active April 28, 2017 19:23
Google remarketing code for Shopify
{% comment %}Create a file called `google-remarketing.liquid` in the snippets subdirectory of your template with the following code. Be sure to insert your merchant ID.{% endcomment %}
{% if template contains 'index' %}
<script type="text/javascript">
var google_tag_params = {
ecomm_pagetype: 'home',
};
</script>
{% elsif template contains 'collection' %}
<script type="text/javascript">
var google_tag_params = {
@WesleyDRobinson
WesleyDRobinson / Shopify Checkout Script
Last active October 25, 2019 23:58
Please see comments for more up to date implementations!!
<script type="text/javascript">
!function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
window.analytics.load("
@tixastronauta
tixastronauta / facebook_leads.md
Last active January 2, 2024 18:19
Receiving Facebook Leads on a Webhook
@cvieth
cvieth / Shopify-Checkout-Hack.js
Last active May 20, 2023 09:51
Shopify Checkout Hack - This scipt helps to modify the Shopify Checkout Pages
/**
* Shopify Checkout Hack
*
* This scipt helps to modify the Shopify Checkout Pages. To run this script, add your
* code for each checkout step, compress your code with a tool of your choice and paste
* it to:
*
* Admin > General > Google Analytics > Additional Google Analytics Javascript
*
* @author Christoph Vieth <christoph@vieth.me>
@wrboyce
wrboyce / gist:786460
Created January 19, 2011 17:12
pre-commit hook to automatically minify javascript/css
#!/usr/bin/zsh
COMPRESSOR=$(whence -p yui-compressor)
[ -z $COMPRESSOR ] && exit 0;
function _compress {
local fname=$1:t
local dest_path=$1:h
local min_fname="$dest_path/${fname:r}.min.${fname:e}"
$COMPRESSOR $1 > $min_fname