Saturday 29 December 2012

Introduction to Google Tag Manager


Ever had issues keeping track of which tracking codes go where? Whether it’s Google Analytics, Bing, AdWords or remarketing, the simple truth is that there are a lot of different snippets you need to keep track of these days. That’s where Google Tag Manager comes to help out! What’s the scoop? Google Tag Manager was launched back in October as a way to keep all of your tags in one place. Not only does this help keep source code cleaner (by being placed in the correct place), and theoretically speed up website loading times, it also means that multiple users can make remote changes to website codes without needing the help of a developer. This is great if you work with particularly unresponsive developers – it means you can handle all code changes quickly and easily without having to wait for a new release. It also means you can have different teams making changes remotely – such as your PPC agency, your in house content team, and your developer team, without having to go through complicated channels. Structure Overview: Once you sign up for Google Tag Manager you have the option to create new or see your existing accounts. If you work for an agency, you should have an account for each client whose GTM you manage.
Within each account you have buckets that Google calls ‘Containers’ – these are where you group similar sections of code. In the example shown below – we have an account for Hanapin Marketing, but separate containers for PPC Hero and for Hanapinmarketing.com. The reason for this is because we have separate Analytics codes for those two sites, and separate AdWords accounts and tracking codes, hence they need to be kept in separate buckets. If we had a subdomain such as blog.hanapinmarketing.com, we would keep that within the Hanapinmarketing.com container as some of our codes will still apply to that part of the site.
Once you have your containers set up, you might want to give access to other users. This is very straightforward and you can control permissions at the account and container level.
Adding Tags: Assuming you’ve set up your account and containers and added relevant users, you’ll want to start building out your list of tags. In our case that meant adding Google Analytics, Google AdWords conversion tracking, Google AdWords remarketing and Bing conversion tracking. This is actually pretty straightforward to do. Go into one of your containers and in the top right corner select ‘New Tag’.
From here you will see a drop down list of the tags Google is able to implement for you:
Select Google Analytics from the drop down and name your Tag something obvious like ‘Google Analytics’. Here is what you should see:
You’ll need to find your Analytics ID – you can find this by going into the Analytics admin tab and selecting the web property associated with your site. You’ll then need to set up a rule for when this code shows – in my case I’ve used the generic ‘all pages’ rule, but you might only want this particular code to show in a certain subdomain or on certain pages. To do that you simply need to create a new rule:
You can also add rules to block showing your code for – e.g. test areas of your site. In the ‘more settings’ drop down you have the option to block specific referrers or organic keywords from triggering your tag as well as a number of other features. The next tag I want to create is the Google AdWords conversion code. Again, Tag Manager has a default option to make this easier for you:
You can get your Conversion ID and Conversion Label by going into you AdWords account and looking at your existing code. As you can see, I’ve set up a rule for my AdWords code that it only appears on our ‘/thankyou’ confirmation page. If I were to add another conversion path in future with a new thank you page, it would be really easy to make this code fire there, simply by adding a new rule with my new URL. For Bing, things aren’t handed to you as prepackaged as they are for Google products, but it’s pretty simple to add your code in. Simply select custom HTML code and paste in your Bing conversion code.
Again, I’ve set this to only fire on the ‘/thankyou’ page. That’s the basics of adding tags sorted. Let’s talk a little bit more about rules and macros! As mentioned above, rules tell your tags when to fire. In Hanapin’s PPC Hero container you will see something like this:
The PPC Services Remarketing rule means that our remarketing tag will only fire on our PPC Services page. Pretty straightforward right? Using Macros enable you to do more advanced things with your tagging. For example you can use macros to look at certain data from your other javascript and determine whether a code should show. For an eCommerce client we set up a Macro to pull the transaction amount from their cart Javascript in order to include revenue data in Google AdWords’ conversion tracking.
The default Macros available are: URL – let’s you set rules depending on the URL of the page. Referrer – rules based upon the referring site (show specific remarketing codes to users who visited PPC Hero before visiting Hanapin Marketing etc) Event – rules based upon users who performed a specific on site event such as watching a video. Here’s how our list looks:
I recommend you check out the Google Tag Manager support section on Macros if you’re thinking of using them as they aren’t for beginner users. Finalizing Once you’re happy that you’ve got all the tags you need with the correct rules to show them – you can switch over to using Tag Manager. First, check that all your account settings are correct:
If you’re happy that’s all good, you’ll need to remove all your old tags (that you now have in GTM) and replace them with the Tag Manager code snippet.
You can find this in your settings menu, and you’ll have a different snippet per container in your account. You want to place this code immediately following the opening tag. And that’s it! Pretty straightforward really and should make things much easier for you in the long run. If any of you have positive or negative experiences with the Google Tag Manager let us know in the comments below! Source web page...http://www.ppchero.com/introduction-to-google-tag-manager/

Google Tag Manager part 2: event tracking


October 31st, 2012 This is part 2 of the Google Tag Manager (GTM) series. In part 1 we have gone through the basic concepts of GTM, in this post we will start implementing one of the most frequently used feature – Google Analytics event tracking in GTM. When to use event tracking Before I rushed into the settings and codes, let’s slow down and think about this: when should I actually use event tracking? When you want to record something other than page visits like user interactions, you use event tracking. For example, you want to track whether a particular button is clicked, or you want to know how many people has actually played the video on your site, you use event tracking. How to implement Google Analytics event tracking To implement event tracking, you need to have the Google Analytics code on your page first. Then you call the following JavaScript function when the event appears: 1 _trackEvent(category, action, label, value, noninteraction) The parameters are: Category: category of your event Action: action of the event, for example, play, click, etc Label (optional): label to identify your event. For example, it can be your banner ads tagline Value (optional): an integer value in case you want to provide a numeric value for the event Non-interaction (optional): a Boolean flag to determine whether this event is included for calculating the bounce rate. Sounds weird? See the explanation here. Let’s say you want to see if the winter promotion link is clicked, you will have something like this: 1 Winter promotion page You can find the official documentation from Google here. How to implement event tracking on Google Tag Manager Actually even if you’re using GTM, you can still use the _gaq.push mentioned above as the _gaq object is still there when the Google Analytics tracking code is loaded by the container script. However, since we’re migrating to GTM, let’s try to do things in a “GTM way”. Remember from part 1 of this blog series we have 3 key elements in GTM: tags, macros and rules. Let’s tackle them one by one: Macros
This time I will start with macros first. As mentioned when we do event tracking, we need to pass several variables (e.g. category, action, etc) to the _trackEvent JavaScript function. in GTM we will first define them accordingly as macros: Choose the Macro Type as “Data Layer Variable” and save the macro. You should see there’re 5 more macros when you’re done:
Tags The next step is to create the actual tag that the page will load, in our case, the Google Analytics event tag. When you create a new Google Analytics tag, it allows you to specify whether it’s an event tag or not:
Once you’ve selected Event Tracking, you will see the Event Tracking Parameters section. Remember you’ve defined them all as macros already? Simply select them from the pulldown and it should look like this when you’re done: Rules
The last configuration we need is the rule to trigger the tag we created. Let’s assume whenever there’s an event “GAEvent” appears in a page, we will load the tag. Click the “Add Rule to Fire tag” button below (you should still stay in the create new tag page) and create a new rule as follows:
Save the rule and the tag and we’re done with all the required setup in GTM already! But wait…how can all these linked up together and what JavaScript function should I be using when events appear? All the magic happens with the GTM DataLayer. According to developers guide from Google: the data layer is an object that contains all of the information that you want to pass to Google Tag Manager So let’s say in your ecommerce site you want to tell GTM the total revenue generated on the confirmation page, you will need to define a data layer object and associate the key and corresponding values in pairs as follows: 1 2 3 dataLayer = [{ 'ecomValue': '2000' }]; Just simple as that. By default the data layer object is using the variable name ‘dataLayer’, but you can change it if you want. You can find more information from here. So in order to trigger the event tag and pass the required parameters to Google Analytics, we just need to call the push function of the dataLayer object as follows: 1 2 3 4 5 6 dataLayer.push({ 'eventCategory': 'the event category you want', 'eventAction': 'the event action you want', 'eventLabel': 'the event label you want', 'event': 'GAEvent' }); Suddenly everything comes together right? To break it down: You put ‘GAEvent‘ as the ‘event’ value, so that the rule you’ve defined will be matched and thus firing the tag you’ve specified You put the values that you want to pass into the event tracking tag by matching the macros you’ve defined (so it’s IMPORTANT to declare those macros as data layer variables . GTM will carry forward these values and put them to the actual event tracking tag Now go to your Google Analytics and the event data should be ready for your visit. The data layer approach introduced in GTM can be very useful and powerful, will try to find more examples on how to make use of this killer feature to make our lives easier. Related posts: Source Web page ..http://www.whymeasurethat.com/2012/10/31/google-tag-manager-part-2-event-tracking/

Google Tag Manager - Setup, Features and Benefits


Google Tag Manager (GTM) is a free solution for managing Google Analytics, advertising and other tracking tags across your website (or multiple websites). Tag Manager allows you to install a single, universal JavaScript tag, which you can then use to insert other JavaScript tags based on rules that are specified in the tool.
Google Tag Manager replaces the traditional approach of individually including tags in the source code of your site(s) and can produce dramatic time savings in tag deployment and management. Although the tool is closely tied to Google Analytics, it is a stand-alone tool and needs to be setup and configured outside of Google Analytics. Who Should Use Google Tag Manager? The tool is designed for medium to larger scale websites and organizations that have multiple websites. If you just have a single, small to medium website and are not using a customized or advanced installation of Google Analytics (i.e. Event Tracking, Custom Variables, etc.), then you don’t need to rush to get Tag Manager installed on your website. If you are looking to expand your use and customization of Google Analytics or are looking to install additional tracking tags, then it might be worth setting up Google Tag Manager now to make your life easier in the future. Google Tag Manager Terminology (1) Account Think of your Tag Manager account like your Google Analytics account, each account should only be used to track websites for one company. If you are a looking after tracking for multiple, unrelated companies (e.g. you are an agency) then you should have a separate Google Tag Manager account for each of your clients.
Account Best Practices: One account per company The company for whom the account is managed should be the account owner (2) Container Within your Google Tag Manager account you can set up separate containers (these are like profiles within Google Analytics). Creating a new container will give you a unique piece of JavaScript that will need to be installed on your website(s), this will replace your Google Analytics tracking code. Container Best Practices: Container code must be applied across whole website Generally you should use one container per domain (but just like Google Analytics, you can use a container across multiple domains) (3) Data Layer This is an additional option you have when implementing Google Tag Manager on your website. It makes data easier to access if you want to pull it into tag manager. You can then use the data within tags and even use it to create conditions on when to fire particular tags. If you are currently using Events or Custom Variables in Google Analytics, then migrating these into the Data Layer makes them accessible within Tag Manager. (4) Tags Tags are the snippets of code used to collect data. For example, you might have Google Analytics tags, Google AdWords conversion tracking tags and other third party tracking tags stored within Google Tag Manager. (5) Rules Rules allow you to decide when to fire a particular tag. For example, the following 'fire' rule will only fire the tag on the individual thank you page of the website; url equals company.com/thank-you.html
(6) Macros Macros allow you to access data when the Google Tag Manager loads on a page. For example, you could feed the value of a transaction into a macro and then use that macro to decide when to fire a Google AdWords Remarketing tag. Before Implementing Google Tag Manager If you have lots of existing tags on your website, then you will need to plan your Google Tag Manager implementation carefully. If you simply remove the Google Analytics tracking code from your website and replace it with Google Tag Manager, you might lose a lot of data, so remember to consider ALL the tags you are using (or customizing); Google Analytics Tracking Code Google Analytics customizations, including; Ecommerce Events Custom Variables Virtual Pageviews Etc. Google AdWords Conversion Tracking Google AdWords Remarketing Tags DoubleClick Tags Other custom tags Google Tag Manager Setup Watch our Google Tag Manager Setup video or follow the steps below. Step 1 Log into Google Tag Manager at www.google.com/tagmanager/ and create your account and your first container. Step 2 Install the Tag Manager code on all the pages of your website(s) immediate after the opening body tag. Step 3 Add a tag within the container and insert your Google Analytics ID (e.g. UA-123456-1) and define when you want the tag to load on the website. Selecting the default 'all pages' rule will mean the tag will load on every page that the Tag Manager code is installed. Step 4 To publish your container (i.e. push the tracking onto your live website), on the 'Tags' > 'Overview' page click on the 'Create Version' button and then click on the 'Save and Publish' button. Source page...http://www.analyticsresults.com/2012/10/google-tag-manager-setup-features-and.html

Friday 28 December 2012

GOOGLE TAG MANAGER OVERVIEW


<< BY JESSICA DAVIDSON ON DECEMBER 13TH, 2012 Between Google AdWords conversion tracking code, Google Analytics code, and Google
Remarketing code, we often find ourselves and our websites swimming in a sea of tracking code. It can sometimes be a daunting process working back and forth between the marketing and IT teams to ensure that everything is being properly tracked. But what if there was a tool that could ease the management of all of the various types of tracking code that we put on our websites? Well, you’re in luck, in October, Google released its Google Tag Manager that does just that. What is Google Tag Manager? Google Tag Manager is a free tool that combines all of the tracking code tags that you utilize on your website into a single, concise piece of code. This code signals to the Google Tag Manager to fire certain tracking code depending on the tags and rules you define in the interface. Now, instead of having three or four different sets of tracking code per page, there is just one piece of code that can fire various types of tags depending on the rules you set. How Google Tag Manager Works Google Tag Manager contains 3 main components: 1. Container In order to employ the various tracking code needed for your website, a single piece of code must be added. This piece of code is called the container. The container holds all of the tags for your website. You can access the container code once you set up your Google Tag Manager account. The container code is placed on every page of your website after the opening tag. Once you have added the container code snippet, remove all of the old tracking code, like Google Analytics and AdWords conversion tracking code, which you will be adding and managing via Google Tag Manager. 2. Tags The container that you first add to your website will be empty, therefore, the next component that needs to be added is the various tracking code tags. The tags you remove from your website in place of the Google Tag Manager container will need to be added during this step. You can choose from various built-in tag templates in Google Tag Manager, which include: AdWords Conversion Tracking AdWords Remarketing Google Analytics DoubleClick Floodlight Counter DoubleClick Floodlight Sales Or, you can add custom HTML tags (for custom javascript tags) or custom image tags (for 1×1 pixel tracking images) that are not included as built-in templates. 3. Rules Next, you must set up rules to define when the tags should be fired. Setting up rules in Google Tag Manager is similar to setting up goals in Google Analytics. Google Tag Manager supports the following types of rules: URL-based Rules: The tag is fired based on a particular URL. You can define the rule so that the tag is fired on all pages, such as for Analytics code to track visits or for a particular page like a thank you page for tracking Google AdWords conversions. Referrer-based Rules: The tag is fired based on the referral source for the page. For example, the tag can be fired when a user visits the page via a particular affiliate or if the user visits the page after visiting another specific page on your website. Event-based Rules: The tag is fired based on a particular “event” on the website. For example, the tag is fired when the user plays a video or clicks a button. Debug Console By creating and managing various tags and rules yourself, it is imperative that they act and track as intended. For this purpose, Google Tag Manager provides the Debug Console. In the Preview & Debug Mode, as you visit different pages on your website, a window at the bottom of the browser appears that displays whether or not each tag is fired. Publishing Once you have created your container, tags, and rules and ensured that the tags fire correctly, make sure you publish the version of the tags created. Although this may seem to be common sense, it is often overlooked and users believe that tracking begins once the tags are created. With that being said, make sure you hit the publish button when you are ready for your tags to go live. So, should you consider utilizing Google Tag Manager to manage your website’s various tracking code? Consider the following pros and cons before moving forward with its implementation. Google Tag Manager Pros Marketers can add tags whenever they please without having to coordinate with IT to put additional code on the website Less code to manage on your website Easy to use interface All of your tags can be seen in one place – You don’t have to go to multiple pages to determine everything that you are tracking and on what pages the tracking code is placed. Debug Mode – This tool allows you to see if your tags are firing correctly. Google Tag Manager Cons Initial Setup – The initial process to set everything up – adding the Google Tag Manager container, removing all of the old code, and determining what tags need to be tracked and where – takes some time and coordination. Once the initial setup is complete and correct, you will not have to worry about this process anymore. Debug Mode – Although it tells you whether or not tags are fired, it still takes some investigative work to determine why the correct tag is not firing or why an incorrect tag is firing. Although it is a simple tool with an easy to use interface, it still requires a good understanding about how the tags are fired in order to correctly set up the tags and rules as well as debug issues with tag firing. Because of this, it may still take some coordination with IT to solve any problems if things are not tracking properly. For more information about Google Tag Manager, check out their recent webinar about the new tool. Have you starting using Google Tag Manager? Let me know about your experience with the interface, any problems you have run into, or any additional benefits. Find me on Twitter or Google+. Source code http://blog.search-mojo.com/2012/12/13/google-tag-manager-overview/