Cover photo
Verified name
Andy Scott
Works at Perficient
Attends Hard Knocks University


Andy Scott

Shared publicly  - 
Better QA With Google Tag Manager Environments

GTM published a huge update just today. Environments lets you create a setup in Google Tag Manager, to which you can publish container versions. You can share the preview link for this setup, or authenticate this setup with a special container snippet you add to the site template. If someone is authenticated against an environment, they can access any versions that are published there.

In other words, this is a huge boost to container workflow, as you can pass a version through various environments (dev, QA, staging) before pushing it live.

The major difference to the old "Share Preview" link is that the preview sharing shared container versions, so if you created a new version you had to distribute a new link. Now you share environments, and you only need to distribute the authentication token once (unless access is revoked).

Read the guide, and start working in environments!

#gde #googletagmanager #blogpost #gtmtips 
A walkthrough of the Environments feature in Google Tag Manager.
View original post
Add a comment...

Andy Scott

Shared publicly  - 
Need something to do this weekend? Here's 12 of the Best Resources to Learn to Code for Free
View original post
Add a comment...

Andy Scott

Shared publicly  - 
Grabbing Google Analytics clientID and trackingID from the console

So I've been playing around with the the console a bit more (specifically chrome) and wondered how I would query a site to get GA data such as trackingID or clientID. Sure this data is easily found in some plugins or looking at the stored cookie values but sometimes its just fun to see what you can pull from a command line interface. *cracks knuckles like I'm about ready to hack into Fort Knox* After a some searching I found the solution here.  You can do this by using the ga() command queue. (

Provided you only have one GA tracking ID you can use 


if you have more just change the index value from 0 to the one that matches the tracking ID you need.  If you don't know your can find out with this console query...

ga.getAll()[0].get('trackingId'); //again change index value as needed.

As a side note, if you're looking to scoop up the clientID into a custom dimension +Simo Ahava has a great guide with a more elegant GTM solution found here: 
Track Google Analytics user ID when the visitor is not logged in your website for later customer life-cycle analysis by matching it with your CRM IDs.
Add a comment...

Andy Scott

Shared publicly  - 
Pushing Data Layer Array items into Custom Dimensions in Google Analytics

So I have a GTM plugin running on a blog (Wordpress) and its scooping up various aspects of the posts (time posted, author, category) and the post categories (if the posts are tagged in several) are stored in an array format within the Data Layer.  

Do I need to create a custom dimension for each possible index in that array object on the off chance it'll scoop up more than one category on posts?

Even if there was some way to loop it, I would think that the default method for sending custom dimensions along with the pageview hit would require several CD's to be used for this method.

Ecommerce does this already with several items in the cart but that's a default function so I SOL?
1 comment on original post
Add a comment...

Andy Scott

Shared publicly  - 
I'll take two please
Mario Gutierrez's profile photo
One has to wonder how a product like this ever gets created and funded...
Add a comment...

Andy Scott

Shared publicly  - 
Clients. Can't live without 'em, can't make sense of 'em.

Image Liberated From That Other Social Network

26 comments on original post
Add a comment...

Andy Scott

Shared publicly  - 

what is the best way to call a function inside a Variable (custom js)?

function() {

    function Encrypt(str) {
       foo = str + '-' + string2;
       bar = Encrypt_again(foo);
       return bar;

    function Encrypt_again(str) {
       foo = str + 3 * 2;
       return foo;

    var string = "abc";
    return Encrypt(string);

Important is, that I have multiple predefined functions with a small code, which are not accessible on the server.
Inside the Encrypt function another function is called.

Thx for your help.
2 comments on original post
Add a comment...

Andy Scott

Shared publicly  - 
Iframe Cross-Domain Tracking in Google Tag Manager

Here's an article I wrote about tracking iframes cross-domain with Google Tag Manager. It's not the simplest thing to do, as you have to reload the iframe with the decorated src. Nevertheless, this gets the job done nicely, though you can always improve the solution. I've linked to some good guides in the article as well (mainly by +LunaMetrics and +Knewledge) which you might want to check out.

If you can't be bothered to read the article itself, at least read the Summary chapter. Writing it was pure, unadulterated catharsis for me.

#gde   #googletagmanager   #blogpost  
View original post
Add a comment...

Andy Scott

Shared publicly  - 
exactly !! A sewer dwelling rat... still does his job :D!!
10 comments on original post
Kerry Amburgy-Dickson (Kalex)'s profile photo
Add a comment...
Andy's Collections
Digital Analytics
nunchuku skills, bow hunting skills, computer hacking skills
  • Perficient
    Senior Digital Analytics Consultant, 2011 - present
  • Llywelyn's Pub
    Food Runner, 2010 - present
  • Network Solutions
    Corporate SEO Developer, 2006 - 2011
Basic Information
Looking for
Friends, Networking
Digital Analytics Guy
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 Digital 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."

"Never be the smartest person in the room"

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

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

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

"I'm 25% funny and 85% bad at math"

"Even a stopped clock is right two times a day"

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.
  • Hard Knocks University
    Failing at everything, present
  • University of Missouri, Columbia
    Computer Science
  • St Charles County Community College
    Multi Media and Web Design
  • Elsberry High School
    1996 - 1999