Analytics Content Grouping Using WordPress Categories and Not using Googles Tag Manager

Analytics Content Grouping can be very useful to see how a range of products is doing in the market in a quick and intuitive way and also allows for some interesting insights that are hard to get to in any other ways.

In the past I have relied on manual tagging of pages, but over time as new pages are added, this manual tagging drifts and the ‘not set’ category increases. As a way to automatically group pages a great way would be to use WordPress categories and group based on category names.

Before I go any further I should add that most of the pages I want to group are product pages and all of them are in multiple categories. For example a product might be in a categories for products, industrial, steel and more. This method is based on picking out a few of those categories only as groups. In this case Industrial is the group I want to add this to. If you have pages with 1 category only, there are other methods that are even more automated (see below).

I should add that this method is loosely based on the article of https://www.highposition.com/blog/how-to-send-author-content-groups-wordpress-google-analytics/ and I will follow the same steps that they take you through: –

Step 1 – Configuring Content Groups

Log into your analytics account and click on the Admin link in the top menu bar. Select the account and property you want and in the View section on the left, you should see Content Grouping: –

analytics-content-groups-setup1

We then need to create a new Content Group

Click the “Create New Content Grouping” button at the top.

Add in the title of your Group, in our case “Categories”.. but you can call it anything you wish.

Just below the title is where you select the tracking method you wish to use, we will be tracking via the GA javascript code, so click the first option, “Group By Tracking Code”, you don’t need to change anything on this screen, just press “Done” at the bottom.

Now do the same process again for any others you want to add to a maximum of 5, but when clicking the tracking code implementation option, make sure you change the “Index Number” option, so they are unique.

Step 2 – Modifying the Analytics Tracking Code

This article assumes that you are using the universal analytics code that Google has been pushing for some time. The code you have running on your site should therefore look something like this: –

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-XXXXXX-X’, ‘auto’);
ga(‘send’, ‘pageview’);

</script>

We want to change it to add an extra line as shown below (in this case to add the category name, which is industrial to contentGroup4, which is the one I set up in the step above: –

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-XXXXXX-X’, ‘auto’);
ga(‘set’, ‘contentGroup4’, ‘Industrial’);
ga(‘send’, ‘pageview’);

</script>

 

Find this code in your site. In theory it should be in the head section, but I load mine in the footer just in case Google is slow (which is quite often). You will often find this code in either the theme settings, a wordpress plugin or in the footer.php or header.php of the theme you are using. The code should look exactly as the top example above, so, after backing up, make a space between the ga(‘create’, ‘UA-XXXXXX-X’, ‘auto’); and ga(‘send’, ‘pageview’); lines to type in your new code to add the content groups.

The code I am using assumes that you know the groups you want to track, you have a page in multiple categories (see below if you have 1 category) and you don’t have many groups (as each one needs a line of code).

<?php
if(in_category(’19’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial’);\n”;}
elseif(in_category(’16’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial2’);\n”;}
elseif(in_category(’18’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial3’);\n”;}
elseif(in_category(’11’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial4’);\n”;}
?>

So this is very simple, each line checks to see if the page is in a particular category and if it is adds the analytics code to tag to page. In more detail:

if(in_category(‘19‘)) – Checks to see if the page is in category 19. You can get the category number easily by going to the category page in WordPress (under Posts), finding the particular category you want, then hovering your mouse over the top. In most browsers you will see the url of the link you would go to if you clicked. In that url you will see “tag_ID=19” in this case, but the number is the number you need to enter here.

{echo “ga(‘set’, ‘contentGroup4’, ‘Industrial’);\n”;} – This bit is just the code from analytics, but I have manually written in the category name. In this case Industrial. You could do this in code, but if I am setting the category ID for an individual line, you might as well just add it in manually. \n gives you the line break.

If you add that in to your analytics code it should look like the below: –

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-XXXXXX-X’, ‘auto’);
<?php
if(in_category(’19’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial’);\n”;}
elseif(in_category(’16’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial2’);\n”;}
elseif(in_category(’18’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial3’);\n”;}
elseif(in_category(’11’)){echo “ga(‘set’, ‘contentGroup4’, ‘Industrial4’);\n”;}
?>
ga(‘send’, ‘pageview’);

</script>

Once you load up a page this should then be tagged appropriately with the categories you have set.

Step 3 – Viewing Your Data

Once this new data has begun flowing in to your GA account, head over to your All Pages Report….  Behaviour -> Site Content -> All Pages

analytics-content-groups-setup2You will see a new option appear at the top of the report asking which content group you would like to see your pages grouped by. You should now see your groups in there. Select the group you want and it will show you pages together with useful on-site behavioural metrics. This can be very useful to see how certain sections or product ranges are performing against site stats over time.

Another interesting way to display this information is in a Dashboard. I particularly like to use the map view on the dashboard so I can see how particular groups are performing in different parts of the country or the world: –

 

 

If you have Single Category for Each Page

If each of your pages only has a single category, and you have a much larger range of categories. You may want to use this code instead as it automatically fetches the 1st category the post is in. Note that this is for Universal Analytics and also creates a group for the first tag. If you don’t want the tag group, just delete that section: –

<?php if (is_single()){
while(have_posts() ) : the_post();

$category = get_the_category();
if ($category && !empty($category[0]->cat_name)){
echo “ga(‘set’, ‘contentGroup4’, ‘”.$category[0]->cat_name.”‘);\n”;
}

$tag = get_the_tag();
if ($tag && !empty($tag[0]->tag_name)){
echo “ga(‘set’, ‘contentGroup5’, ‘”.$tag[0]->tag_name.”‘);\n”;
}

endwhile; // end of the loop.
}
?>

Explanation

<?php if (is_single()){
while(have_posts() ) : the_post();

………..

endwhile; // end of the loop.
}
?>

This section just makes sure that the page includes a single post only.

$category = get_the_category();

This section creates a group (array) of categories.

if ($category && !empty($category[0]->cat_name)){

This makes sure there is a category assigned and if there is applies the category name rather than the ID number or slug.

echo “ga(‘set’, ‘contentGroup4’, ‘”.$category[0]->cat_name.”‘);\n”;

This is the section that actually writes the line into the page html (echo). In this case the start of that is all just text from Google analytics. Change contentGroup5 to whatever content group you have set in the Analytics admin panel. The options are basically contentGroup1 to contentGroup5. The next bit ‘”.$category[0]->cat_name.”‘ is really the crucial bit that pulls in the category name. This will be the first category on the list you see in the pages, All pages list in WordPress.

Google Insights

 

 Google Insights is a new tool from Google that really surpasses the keyword tool in some areas. Where the keyword will suggest many different possibilities that will narrow the keywords you are targeting Insights will only give you the top 10. However where it has significant advantages is its geographic targeting. For example you can pick Australia or a state (unlike the keyword tool where you can only pick the country). If you do pick Australia it will break down search volumes by state so you can get some idea of where you should target, or even where you need to set up your distribution centre.

 

Insights for Ski in Australia
Insights for Ski in Australia

 

The other area that is useful is that you get a graph going back to 2004 that shows searches per month. This gives you a great idea on what is happening over time, whether there are seasonal variations and even whether you are about to enter an increasing or decreasing market.

One thing to note is that get numbers to show on the graphs, you will need to have a Google account. You can get one of these by signing up to Gmail or many of the other Google services. However one word of caution is that these are not absolute numbers they are normalised against the highest figure (ie if the top search volume was 1000 and the months search was 700, the value would be 70[%]).

So you would use this to look at your market trends over time where as the keyword tool would still be your primary research tool for looking which keywords and phrases to optimise for.

Animoto update

Animoto have just updated their app to allow you to download a high RES mpeg4 and ISO (DVD) file. It costs $5 but is well worth it.

Resolution is doubled so will play well on a monitor and even scales to plasma or LCD screens.

We are using it to produce slick video which we play on digital photo frames in our office reception areas.

Only grumble is they still add the animoto logo and google checkout or paypal accounts are difficult in corporate environments.

Getting through to a sales team

I have been working in a b2b marketing position for around 8 years now, and the marketing department has gradually expanded from a single person low level job, to a 3 person department. In all that time however we have had one major issue, how to get feedback from our sales team in a cost effective manner.

Firstly I should explain that the industry I work in sells to electrical wholesalers, switchboards builders etc., and our sales team are all from this industry, so they are ex-electricians etc. Most are not very computer literate, to say the least, although they all have company supplied laptops and an always on data connection, allowing them to receive email at any time.

Over the years we have: –

  • Been to all the sales conferences
  • Responded to the usual suggestions (buy more shirts)
  • Send out a monthly newsletter of what marketing is doing
  • Send out emails when something new is available
  • Provide detailed instructions on how to use items, if they are complex
  • Done surveys to increase participation
  • Emphasised in communications that our objective is to reduce work for them
  • Requested feedback on programs we have initiated

However, in all this time we get almost no response from the teams, they don’t hand out calendars etc we give them, they don’t follow up on leads from the website, they continually tell us that they are unaware of things that have been in emails, meetings etc. The reason I mention calendars is because I recently did a talk to a group of local wholesalers we have regular contact with, and asked them how they were going with the competition attached to it. 80% hadn’t even received the calendar (and it’s May) but wanted one when I told them about it. On closer inspection we found boxes of calendars where they keep their literature.

The reason for my post is that for the first time I am going to try an email marketing tool to track what our sales team actually look at in our communications, and therefore make sure that if they aren’t looking at something we can give them a nudge to do it. Is this bad? Has anyone else had any luck approaching their sales teams in other ways?

BTW – It’s also good to vent!

Is the role of marketing expanding?

The company I work for have had me working in marketing for some time (7 years or so), and we have traditionally marketed to our customers, potential customers, and to our internal clients in a more limited way. However in recent times we are being asked more and to market to the community in general.

This of coarse could be the sign of a growing company, but interesting the reason for our efforts are to recruit worker from local schools around Brisbane.

It seems strange to me, coming from a position where I left school in the 80’s, to have companies trying to recruit, rather than just ‘sticking a job in the paper’.

I guess this is a sign of the times, where skilled workers are very hard to find, and even harder to retain, but my feeling is why go after the school kids, who will always be like that. Why not chase mothers with school age kids? Offering them positions to fit in with dropping off and picking up seems like a sensible way to get and retain good staff.

Is Copy Part of Web Design

I came across this as a discussion point from the boagworld podcast, and thought that it was somethning I could comment on. The reason I think I might be able to add to this debate is that unlike most of the people speaking on it, I work in a marketing department that happens to be geeky enough to design, code and write our own sites. We are therefore creating the complete site including copy.

Okay have said that, as usual there seems to cases for and against arguing that the copy is part of the design. As I see it these are as follows: –

Cases for copy being part of web design

  • The style of the copy should match that of the design. It is no use having a very corporate looking site, and then using informal language in your copy. Equally an eclectic looking site should not be written in a formal style.
  • This is the most important one for me…SEO. Your content needs to be written in such a way that it is both attractive and easy to scan and read, as well as being search engine friendly. Meta descriptions, headings  etc also need to match the content. This is not an easy job, and is certainly not something that you can just re-use content from your brochure, or sales letters and plonk it in. It is also something that in my experience, requires a bit of experience, and enough time to research how to make the most of your heading, what you can and cannot do etc.
  • The copy should also be brief and pointed. Something us marketers sometimes have trouble doing. It should also be largely ‘sales talk’ free. One way to quickly lose a web user is to pitch to them!
  • Keyword research allows the correct search terms to be targeted rather than terms that are used by the company.

Cases against copy being part of web design

  • A big problem is often that the web design company will have no experience in the particular product or service on the website. The only way to get them up to speed on it would be some level of product training, or providing notes or other promotional material that they can base their copy on. However in our experience copywriters only rarely do a good job, and writing in a web style may mean that it looks worse than it actually is. In general us marketing types like to word things certain ways to match our customers requirements, and there is often good reason for that.
  • Use of material. This is also a big one. To be honest I hope this objection is dying out, but many old school marketers don’t want their information re-used or re-purposed in ways that they are not totally aware of.
  • Terminology. This can be an issue if particular language is often used at a company. I run across this frequently at the company I work for. My favourite terms I have managed to cut out in the last few years are ‘double return flat face gutter’ and ‘full length butt hinge’. I’m sure these are important to our designers, but to most of our customer, this means nothing. However in many cases certain terminology might conflict with key word research.

Conclusion

So what would be my conclusion from this? In my opinion the advantages of having copy as part of the web design process far outweigh the disadvantages. A good copy writer should be able to take content given to them and repurpose it so that it hits the correct keywords, is more scannable, and still meets the marketing requirements (if those are made clear to them).

The third point I made up in the againsts, is really a for if you turn it around. Company specific terminology should not be used on a website, more generic terms make things easier to understand and opens up the site to a far wider audience of clients which may not have dealt with you before.

Do I think this will happen quickly? Probably not! Traditional marketing may not quite get the web yet, but try selling your services to companies that do, or alternatively companies that don’t have a large enough marketing team to do it themselves. Once you have a few under your belt, you will probably find that you can get others by reference.

The use of Personas in Marketing

You may be familiar with the use of personas for design. These are the summary of a typical users characteristics in a short page or so, often giving details of their working day, gender, age, what is important to them in their job, who they report to, what they like to do outside of work etc.I have recently had personas developed for the majority of our typical users. To do this we interviewed sales people about what they thought of a person and pretty much took it from there. I am now about to present these to the sales team and try to get their buy in on the project. Basically I would like them to look at personas when requesting literature, and try to give us in marketing an idea of who we should be writing for.My problem will be that the persona will be based around a particular person, or combination of people that the particular salesperson had in his mind eye at the time, and I am sure that will be controversial.At the moment I am wrestling with the problem of should I allow changes? The trouble with changing a persona is that it will tend to dilute it and make it what we think it should be as a group, rather than a particular case which we know to be the case. I will let you know how I go. The presentation is on Friday, so I’ll have to have my arguments together by then! 

Tad cards handed out in Brisbane

The cards for tad.tw got handed out yesterday. I am waiting with bated breath to see if anything happened to my stats.

I am also going to write press releases etc over this weekend and see if I can shoot them off to a few places so that hopefully it will get picked up.

Mobile marketing is pretty tricky. I am not sure how to approach the SEO or the traditional marketing side really. Standard websites are much easier!

Overlay.tv

If you haven’t seen overlay.tv yet, take a look. You can overlay video off YouTube with info and embed it in your blog.

This is a great tool for all you marketers out there (like me). If you are looking at fashion brands you could video you shows then add tags so that people can just click on them and buy them online.

I’ll try to get one up in the next few days so you can see what I mean.