Skip to content

Instantly share code, notes, and snippets.

Aaron Dicks aarondicks

Block or report user

Report or block aarondicks

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 title tag fun
jQuery(document).ready(function($) {
/**
* Title tag fun
*/
var message = "Come back for more! 🎉";
var original;
$(window).focus(function() {
if (original) {
document.title = original;
}
View Google Sheets Script uptime checker
/**
* Website uptime checker for clients at Impression
* Inspired by Labnol's solution (https://lifehacker.com/5896830/use-google-docs-to-monitor-your-websites-uptime)
* By aaron@impression.co.uk for https://www.impression.co.uk
*/
function init() {
if (ScriptApp.getProjectTriggers().length == 0) {
ScriptApp.newTrigger("websiteMonitor").timeBased().everyMinutes(1).create();
}
View wpcf7_event_listener_all_tag.html
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
dataLayer.push({'event': 'form_submitted'});
}, false );
</script>
View wpcf7_event_listener_tag.html
<script>
document.addEventListener( 'wpcf7mailsent', function( event ) {
dataLayer.push({'event': 'form_submitted_'+event.detail.contactFormId});
}, false );
</script>
View Sample JobPosting for SEO Manager at Impression
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "JobPosting",
"title": "Awesome SEO Manager",
"baseSalary": "1000000",
"salaryCurrency": "GBP",
"jobBenefits": "Medical, Life, Dental",
"datePosted": "2017-05-02",
"description": "Impression Digital Ltd seeks a full-time Search Engine Optimisation Manager to grow our clients’ businesses to new heights",
@aarondicks
aarondicks / Auto pause new Added by AdWords Ads - Script.js
Last active Jan 31, 2017
Auto pause all ads automatically added by AdWords over the coming months. Just set this on a regular schedule and forget about it. For more information, please check out our blog post on this here: https://www.impression.co.uk/blog/6003/auto-pause-added-by-adwords-ads/
View Auto pause new Added by AdWords Ads - Script.js
/**
* Script: Automatically pause any "Added by AdWords" ads in your AdWords account.
* This will not work with MCC level accounts - please find our other
* script versions at www.impression.co.uk
*
* Version: v1 - Jan 2017
* Author: www.impression.co.uk
*/
// Enter your email address here to be emailed a digest when ads are paused
View More complex data layer object
<script type="text/javascript">
var dataLayer = {
"user": {
"id" : 6139
"type" : "member",
"email" : "georgia.goodman@impression.co.uk",
"name" : "Georgia Goodman"
},
"type" : "product",
"product" : {
View Google tag manager embed code
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->
View Product sample data layer object
<script type="text/javascript">
var dataLayer = {
"user_id": 0324334,
"type" : "blog_post",
"title" : "This is a blog post",
"category" : "blogging",
"author" : "Georgia Goodman"
}
</script>
View Simple data layer
<script type="text/javascript">
var dataLayer = {
"foo": "bar"
}
</script>
You can’t perform that action at this time.