We look forward to meeting you.

4Ps Marketing
Studio 16
8 Hornsey Street
London, N7 8EG

Phone: 0207 607 5650
Fax: 0207 900 3834

Online form

Please fill in your details below and one of the 4Ps team will be in touch in the next 24 hours.

Tracking Custom 404 pages

January 21, 2013

Tracking Custom 404 pages

It’s never a good thing when visitors to your website land on a 404 page. It can have an impact on conversion data, as well as decrease the chances of visitors returning to your site. On the other hand, if a 404 page isn’t set up in the first place then you are at risk of damaging your brand’s potential for online traffic, not to mention the brand itself.

As Strategic Digital Marketers, we always advocate 301 redirecting a 404 page to the most relevant content for that page. This will then transfer the power built up in the 404 page to the URL which has been identified as having the most relevant content to suit the search requirements of the user. However, the question you may want to ask yourself is “How do we ensure that we know when a page has a 404 error?” You may answer that question with “Well, we can always check Webmaster Tools.”  Agreed.  But what if the 404ing page is not a crawlable page? 404 pages can be created when someone shares a page on Twitter, for example, or via an e-mail.  Google will not be able to crawl the page in these instances.

So what’s the solution?

By using event tracking, we are able to see the 404ing URL, the source and the keyword that the visitor came through to get to that page. If there is no 301 re-direct or if the keyword search volume is significant, then you may be justified in having a specific page for users coming to the website through that particular source. Still with me so far?

The next step is to put the tracking in place to serve these requirements. This will allow us to see which pages are 404ing in Google Analytics.

The code can be implemented within the <body> tag in the page source.


<script type=”text/javascript”>

var strPage = document.location.pathname;

var pageTracker = _gat.getTracker(“UA-*******-*”);



The element above tells the search engines 3 things:

1. var strPage = document.location.pathname; – This tells Google the naming dimensions of the page to be included within the report i.e. URL, Keyword.

2. var pageTracker = _gat.getTracker(“UA-*******-*”); – This ensures that the events are recorded within the correct Google Analytics profile

3. pageTracker._trackEvent(“Errors”,”404″,strPage,1); – These are the event parameters that need to be shown within the Events report in Google Analytics. This will ensure that the URL and page dimensions are pulled into the report.

How this can be reported in Google Analytics

Tracking 404s in Analytics Example

As a SEO Agency we ensure that we monitor the frequency of visits to 404 pages to ensure that the website is not punished for serving users with inappropriate content. It also allows us to see which areas of the website could benefit from additional content as well as possible keyword opportunities.

Let us know if you think this is important by commenting below. You can also meet up with us to discuss this in more detail by contacting us.

« « Facebook Graph Search | Building Brand Awareness through Social » »
Written by
James Green
James Green
Digital Account Manager
E: James.Green@4PsMarketing.com
T: 0207 607 5657

Want to know more?

Digital Strategy

We will develop a bespoke digital strategy that is specifically tailored to your business objectives and what you want to achieve, according to your budget and timeframe.

Content Marketing

We can help you develop an integrated Content Marketing strategy that will achieve real business benefits. Our in-house content production team can help you produce targeted content designed around your customers in the form of editorial, video and infographics.


Our forward-thinking teams of experts will deliver bespoke SEO strategies to meet your specific business objectives. We will work with you to create an integrated digital strategy, using our knowledge and experience of specific industries to help you achieve success in the shortest possible time.


Combining both sector and PPC expertise, our teams blend strategy, technology, creativity and marketing to optimise your PPC campaigns in order to grow your business and achieve your goals. We take a structured approach to building your PPC campaigns, focusing on driving results while maintaining cost efficiency.

Social Media

Now a valued part of the marketing mix, Social Media Marketing enables direct engagement with your audiences and our teams can help you achieve measurable results by devising and implementing creative social campaigns aligned with your business goals.

Digital Advertising

We offer strategic advertising solutions to help you achieve brand awareness, consideration and conversions and loyalty and repurchase in order to meet your business objectives. Our digital advertising teams work closely with advertising networks and focus on device targeting strategies to reach your clients with effective advertising.

Digital PR

Our growing Digital PR team of experienced PR professionals use traditional online PR practices to seed high quality content on relevant sites, building bespoke mutually beneficial relationships with top tier, powerful and relevant sites.

Web Analytics

Through our deep understanding of web analytics and expertise with all the key market players, we offer auditing, setup, reporting and insight, optimisation/conversion rate optimisation and tailored analytics training to transform your digital marketing strategy.


We offer a range of consultancy services to help our clients facilitate results in a short space of time. Our skilled consulting team, made up of experienced digital specialists, will work closely with you during a period of engagement to devise bespoke strategies to meet your specific objectives.