Profile

Cover photo
Verified name
Andy Scott
Works at Perficient
Attends Hard Knocks University
1,477,051 views
AboutPostsCollections
Story
Tagline
SEO/WebAnalytics Guy
Introduction
I've made computer "things" my life ever since I was 13. I love technology and how it helps us in everything we do today.  I work for Perficient as a business consultant that specializes in SEO and Web Analytics and I work nights and weekends at Llywelyn's Pub St. Charles.  

Self imposed title
: Professional Internet Sponge

Words of wisdom
"Be smart enough to surround yourself with smarter people."

"It never hurts to ask, unless of course you're asking for a beating..."

"If you know something I don't, congrats...you belong to a exclusive club that has 6.8 Billion members."

"Why reinvent the wheel when you can rip off the rocket?"

Circles I might fit in?
  • By day: SEO/OLM/Web Analytics
  • By night: Gamer, Tech Consumer, Electronic Music Lover
Bragging rights
Solved a Rubik's cube while driving in the rain one handed...wouldn't recommend it.
Education
  • Hard Knocks University
    present
  • University of Missouri, Columbia
    Computer Science
  • St Charles County Community College
    Multi Media and Web Design
  • Elsberry High School
    1996 - 1999
Work
Occupation
Digital Analytics
Skills
nunchuku skills, bow hunting skills, computer hacking skills
Employment
  • Perficient
    Senior Digital Analytics Consultant, 2011 - present
  • Llywelyn's Pub
    Food Runner, 2010 - present
  • Network Solutions
    Corporate SEO Developer, 2006 - 2011
Basic Information
Gender
Male
Looking for
Friends, Networking
Relationship
Married

Stream

Andy Scott

Shared publicly  - 
 
 
Thought, I`d would share an interesting solution to a client problem I encountered recently. Think "Red Riding Hood" meets "GTM"...

Problem: In order to appease the growling wolf that is the IT dept, the client needed a "failsafe switch" to block Custom-Ate-TML so that Marketing could play freely in the GTM park: safe in the knowledge that they could`nt (easily) break the website (and thus wont be eaten-alive in "why was the website broken" meetings).

Initially the solution was simple:

// Solution1 - Blacklist a Class of Tags: ...Too Hot - Blocked too much!
   window.dataLayer = window.dataLayer || [];
   dataLayer.push({"gtm.blacklist": ["customScripts"]});

However, due to the lack of wildcard within lookup tables; Marketing had to use a JSmacro. This JSmacro was use to return  UA-xxxxx-1/2, hence if it returned an undefined value, then the GA trackEater broke, hence it need to... not be blacklisted.

// Solution2 - Whitelist Class, but Blacklist ID within the class ...Too cold - much too Blocked!
window.dataLayer = window.dataLayer || [];
dataLayer.push({"gtm.whitelist": [
   // Classes
   "google", // GA + Adwords
   "customPixels", // Custom Image Tag
   "nonGooglePixels", // Mediaplex Custom Image Tag 
   "nonGoogleScripts", // Non-Google Template Tags
   // ID
   "flc", // DoubleClick Floodlight Counter Tag (not classed under "google")
   "fls", // DoubleClick Floodlight Sales Tag (not classed under "google")
   "k"   // 1st Party Cookie Macro
   ],
   "gtm.blacklist": [
   // ID
   "html" // Issue here.
   ]
});

However, it did not work, because as everyone knows... 
   ID="html" is old grandma`s name for Class="customScripts" 
   >> Class="customScripts" includes "jsm" as part of its group of tags
   >>>>> "jsm" is not allowed to run!! And thus it bears "undefined" as its value :(

// Solution3 - Whitelist ONLY ...Just right! Only JSmacros blocked
window.dataLayer = window.dataLayer || [];
dataLayer.push({
   "gtm.whitelist": [
      // Classes
         "google", // GA + Adwords
         "customPixels", // Custom Image Tag
         "nonGooglePixels", // Mediaplex Custom Image Tag 
         "nonGoogleScripts", // Non-Google Template Tags
      // ID
         "jsm", // DoubleClick Piglight Counter Tag (not classed under "google")
         "flc", // DoubleClick Piglight Counter Tag (not classed under "google")
         "fls", // DoubleClick Piglight Sales Tag (not classed under "google")
         "k"    // 1st Party Cookie Macro
   ]
});

Thanks

Phil.

P.S. Suggesting add nesting within "gtm.blacklist": ["ID": {"html"} ] to simplify this issue.
View original post
1
Add a comment...

Andy Scott

Shared publicly  - 
 
Simple ways to access metrics related to your site's 404 errors with Google Analytics and Google Tag Manager implementation.
1
Add a comment...

Andy Scott

Shared publicly  - 
 
 
Fix Google Analytics site search tracking with Google Tag Manager

Tracking site search is pretty difficult if there are no query parameters in the URL. 

In this tutorial, I give you three "classic" site search tracking problems, and a solution for each:

1) Search term as a folder in URL

This is pretty commonplace, especially with Drupal sites. The trick is to utilize a Custom JavaScript Macro, which retrieves the search term from the URL path, and appends it as a query parameter to the Document Path of your pageview tag.

2) Search term in a DOM element on the page

In this scenario, there is no search term in the URL. However, the keyword is displayed in an on-page element, such as a DIV or a SPAN with an ID attribute. Here I use the DOM Element Macro, as well as the Custom JavaScript Macro to retrieve the search term and append it as a query parameter in the Document Path of the pageview tag.

3) No search term anywhere on the page

This sucks, but I've seen it. The trick is to use a Form Submit Listener and a DOM Element Macro to grab the search term from the form field, then to save it as a browser cookie using a Custom HTML Tag, then to use this cookie to append the Document Path with a query parameter in the pageview tag, and finally to delete the cookie using a callback macro in the pageview tag. 

Even if you have no need for site search fixing, the tips in this post should highlight the flexibility of Google Tag Manager, once again. For example, you will never need a second pageview tag for pages with the virtual document path, since you can utilize the "return;" statement in your Custom JS macros to not send the Document Path if a search was not made. Thus the original path of the page is preserved if no search is made, meaning you only need one pageview tag!

#gde   #googleanalytics   #blogpost  
Use Google Tag Manager to tackle problems with measuring internal site search in Google Analytics.
5 comments on original post
1
Add a comment...

Andy Scott

Shared publicly  - 
 
Google Tag Manager makes it easier than ever to store and retrieve cookies, enabling solutions for session or user-level tracking issues.
2
1
Mahmood Hussain's profile photo
Add a comment...

Andy Scott

Shared publicly  - 
 
 
Everything is awesome - but this cake is especially awesome. These newlyweds must make one cool team. LEGO Wedding Cake by Cupcakes by SJ: http://j.mp/1S30D66
67 comments on original post
2
Add a comment...

Andy Scott

Shared publicly  - 
 
 
Sharing some Custom JavaScript Variable cheat sheet - rather simple, but hopefully someone will find them useful. If you have any more frequently used examples would be really interested to hear
Google Tag Manager Variables are awesome and easy to set, but Custom JavaScript Variables do require some JavaScript knowledge and time to write them. So I wanted to have a place where I could store and share scripts I liked or use most frequently.
View original post
1
Add a comment...

Andy Scott

Shared publicly  - 
 
 
When setting a User ID (&uid) on a Universal Analytics tag through the dataLayer, what should 'userID' be set to in the dataLayer when a user is not authenticated?

Is it best practice to remove the 'userID' key from the dataLayer entirely when a user is not authenticated, or will Universal Analytics know to ignore &uid if it is set to an empty string?

Thanks, 
2 comments on original post
1
Add a comment...

Andy Scott

Shared publicly  - 
 
 
I'm having a hard time trying to fire a Virtual Pageview for Universal Analytics code using Tag Manager v2. Do you use the Fields to Set of a PageView track type? 
1 comment on original post
1
Add a comment...

Andy Scott

Shared publicly  - 
 
Very helpful for those pesky "one page sites"  
Instructions for how to use Google Tag Manager with Auto Event Listeners or custom events with a dataLayer push to fire a Virtual Pageview.
1
Add a comment...

Andy Scott

Shared publicly  - 
 
 
Everything is awesome - but this cake is especially awesome. These newlyweds must make one cool team. LEGO Wedding Cake by Cupcakes by SJ: http://j.mp/1S30D66
67 comments on original post
3
1
Isaac Le Pés's profile photo
Add a comment...
Andy's Collections