Deeper page not found wisdom with Google Analytics?
I'm about to migrate a site with 1400+ pages onto Convio CMS. There will be 404s aplenty (ie page-not-found errors), and I need to know what's generating them so that I can address the ones that matter.
I also believe that 404s are something that every webmaster should be tracking.
I'm reading in the support pages that Convio CMS offers no reporting mechanism for 404/page not found errors. Is this true?
I'm considering working with this solution from Google Analytics:
http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=86927
... that involves setting up some javascript to record page metadata to the GA 'view' so that it shows in reports.
Has anyone played with this approach? Does the Convio 404 mechanism allow this approach to work? Are there other bits of cleverness that I should consider?
And yes, I'm aware of link checkers and whatnot, but running a link-checker wouldn't tell me if there's an incorrect vanityURL floating out there that people are trying to use.
thanks!
Comments
-
Alex,
You can do that with a conditional like this in your wrapper:
<t:if test="matches(path,'/404.html')">
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl ." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + " google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._trackPageview("/404.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);
} catch(err) {}
</script>
</t:if>
<t:else>
</t:else>Where /404.html is your File Not Found page as configured in CMS (and UA-xxxxx-x is of course your actual UA ).
0 -
Noah Cooper:
Alex,
You can do that with a conditional like this in your wrapper:
<t:if test="matches(path,'/404.html')">
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl ." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + " google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-xxxxx-x");
pageTracker._trackPageview("/404.html?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);
} catch(err) {}
</script>
</t:if>
<t:else>
</t:else>Where /404.html is your File Not Found page as configured in CMS (and UA-xxxxx-x is of course your actual UA ).
Hey Noah, thanks so much for the quick reply. I've worked with a lot of CMS' in the past, but not so much with Convio yet.
When I tried this approach with another CMS, the document.location.pathname was coming back as 404.html, instead of the page that was deemed not found, so the approach was basically useless.
I was hoping to find out ahead of time whether anyone had already played with this sort of thing in the Convio CMS.
..A
0 -
Alex Bernardin:
Hey Noah, thanks so much for the quick reply. I've worked with a lot of CMS' in the past, but not so much with Convio yet.
When I tried this approach with another CMS, the document.location.pathname was coming back as 404.html, instead of the page that was deemed not found, so the approach was basically useless.
I was hoping to find out ahead of time whether anyone had already played with this sort of thing in the Convio CMS.
..A
Gotcha. In Convio CMS, document.location.pathname will return the page that was requested.
0 -
Thanks again Judah for your confirmation. It helped because I tried to test this and it failed, but your post made me look more closely.
The key discovery that I would add to Judah's comment is that if you put this JS code into the body of the 404 page, it will execute when you have the page editor open. So in my 404 page, I was getting 'body-edit.jsp' as the document.pathname. But when I looked more closely, I was able to verify that it also executes at page delivery, and so it works the way that it needs to.
Putting that code in the wrapper would presumably avoid my little snafu, as long as you make sure that you have the correct pathname of your 404 page.
Follow up question to make my code more bulletproof - is there a Convio template directive to get the current pathname of the 404 page programmatically? It would be hard to notice a dropoff in 404 reporting if I introduce a different page as the site 404...
hm. I suppose I could use JS to trigger it, but that would be a bit stickier...
..A
0 -
Alex Bernardin:
Thanks again Judah for your confirmation. It helped because I tried to test this and it failed, but your post made me look more closely.
The key discovery that I would add to Judah's comment is that if you put this JS code into the body of the 404 page, it will execute when you have the page editor open. So in my 404 page, I was getting 'body-edit.jsp' as the document.pathname. But when I looked more closely, I was able to verify that it also executes at page delivery, and so it works the way that it needs to.
Putting that code in the wrapper would presumably avoid my little snafu, as long as you make sure that you have the correct pathname of your 404 page.
Follow up question to make my code more bulletproof - is there a Convio template directive to get the current pathname of the 404 page programmatically? It would be hard to notice a dropoff in 404 reporting if I introduce a different page as the site 404...
hm. I suppose I could use JS to trigger it, but that would be a bit stickier...
..A
** It's come to my attention that you were really looking for a variable that renders whatever page is currently set as the 404 page. Sorry for the confusion! **
Why yes there is! In Convio CMS, the template syntax is ${path}. That will render on any 404 page as /404.html (or whatever the name of your 404 page is, if you've changed it). Here's what the code would look like:
<t:if test="matches(path,'/404.html')"><br> <script type="text/javascript"><br> var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl ." : "<a href="http://www." target="_blank" rel="nofollow">http://www.</a>");<br> document.write(unescape("%3Cscript src='" + gaJsHost + " google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));<br> </script><br> <script type="text/javascript"><br> try{<br> var pageTracker = _gat._getTracker("UA-xxxxx-x");<br> pageTracker._trackPageview("<strong>${path}</strong>?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);<br> } catch(err) {}<br> </script><br></t:if><br><t:else><br> <br></t:else><br>
Drawing this distinction carefully: When you visit a nonexistent page in Convio CMS, the system will maintain your erroneous URL in the browser address bar, but the actual content it displays is drawn from your 404.html page.
JavaScript is client-side, and doesn't know anything about the CMS filesystem; it's only aware of the URL in your address bar, so the document.location.pathname will display the page you were trying to access.
The CMS template syntax renders the page that CMS is actually displaying. ${path} is server-side, and it so it will render before the HTML actually arrives at your browser; if you use my code above, then reload a 404 page and View Source in your browser, you'll see that ${path} turned into /404.html.
0 -
James Zetlen:
** It's come to my attention that you were really looking for a variable that renders whatever page is currently set as the 404 page. Sorry for the confusion! **
Why yes there is! In Convio CMS, the template syntax is ${path}. That will render on any 404 page as /404.html (or whatever the name of your 404 page is, if you've changed it). Here's what the code would look like:
<t:if test="matches(path,'/404.html')"><br> <script type="text/javascript"><br> var gaJsHost = (("https:" == document.location.protocol) ? " https://ssl ." : "<a href="http://www." target="_blank" rel="nofollow">http://www.</a>");<br> document.write(unescape("%3Cscript src='" + gaJsHost + " google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));<br> </script><br> <script type="text/javascript"><br> try{<br> var pageTracker = _gat._getTracker("UA-xxxxx-x");<br> pageTracker._trackPageview("<strong>${path}</strong>?page=" + document.location.pathname + document.location.search + "&from=" + document.referrer);<br> } catch(err) {}<br> </script><br></t:if><br><t:else><br> <br></t:else><br>
Drawing this distinction carefully: When you visit a nonexistent page in Convio CMS, the system will maintain your erroneous URL in the browser address bar, but the actual content it displays is drawn from your 404.html page.
JavaScript is client-side, and doesn't know anything about the CMS filesystem; it's only aware of the URL in your address bar, so the document.location.pathname will display the page you were trying to access.
The CMS template syntax renders the page that CMS is actually displaying. ${path} is server-side, and it so it will render before the HTML actually arrives at your browser; if you use my code above, then reload a 404 page and View Source in your browser, you'll see that ${path} turned into /404.html.
Hey james,
Helpful information, thank you! I understand the path variable, and it's extremely useful to know how Convio CMS is distinguishing between the requested URL and the served file.
I'm thinking now about the code for the Convio wrapper - the code we're talking about does a simple pattern match to see if it's serving the 404 content, so that it will output Javascript that will put useful information into Google Analytics. That's cool. Now fastforward 6-12 months... the brilliant young coding gun who takes over my job when I win the lottery decides that 404.html is a lousy name for a page-not-found, so she renames that page (in Convio) 'not-found.html'. And our clever wrapper code that was matching on '404.html' no longer matches the way that it's intended to.
Is there any way to make the pattern matching code safe from that kind of change? That's what I meant by is there a way to refer to "whatever the name of the 404 page is"...
Admittedly, it's a bit of a stretch, but it seems worth asking, since obviously somewhere inside Convio CMS there's a DB table entry for "this is the 404 error page for this site".
thanks again!
0 -
Alex Bernardin:
Hey james,
Helpful information, thank you! I understand the path variable, and it's extremely useful to know how Convio CMS is distinguishing between the requested URL and the served file.
I'm thinking now about the code for the Convio wrapper - the code we're talking about does a simple pattern match to see if it's serving the 404 content, so that it will output Javascript that will put useful information into Google Analytics. That's cool. Now fastforward 6-12 months... the brilliant young coding gun who takes over my job when I win the lottery decides that 404.html is a lousy name for a page-not-found, so she renames that page (in Convio) 'not-found.html'. And our clever wrapper code that was matching on '404.html' no longer matches the way that it's intended to.
Is there any way to make the pattern matching code safe from that kind of change? That's what I meant by is there a way to refer to "whatever the name of the 404 page is"...
Admittedly, it's a bit of a stretch, but it seems worth asking, since obviously somewhere inside Convio CMS there's a DB table entry for "this is the 404 error page for this site".
thanks again!
There's no way to do that yet unfortunately, but it is an excellent idea!
0
Categories
- All Categories
- Shannon parent
- shannon 2
- shannon 1
- 21 Advocacy DC Users Group
- 14 BBCRM PAG Discussions
- 89 High Education Program Advisory Group (HE PAG)
- 28 Luminate CRM DC Users Group
- 8 DC Luminate CRM Users Group
- Luminate PAG
- 5.9K Blackbaud Altru®
- 58 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 409 bbcon®
- 2.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- donorCentrics®
- 1.1K Blackbaud eTapestry®
- 2.8K Blackbaud Financial Edge NXT®
- 1.1K Blackbaud Grantmaking™
- 527 Education Management Solutions for Higher Education
- 1 JustGiving® from Blackbaud®
- 4.6K Education Management Solutions for K-12 Schools
- Blackbaud Luminate Online & Blackbaud TeamRaiser
- 16.4K Blackbaud Raiser's Edge NXT®
- 4.1K SKY Developer
- 547 ResearchPoint™
- 151 Blackbaud Tuition Management™
- 61 everydayhero
- 3 Campaign Ideas
- 58 General Discussion
- 115 Blackbaud ID
- 87 K-12 Blackbaud ID
- 6 Admin Console
- 949 Organizational Best Practices
- 353 The Tap (Just for Fun)
- 235 Blackbaud Community Feedback Forum
- 55 Admissions Event Management EAP
- 18 MobilePay Terminal + BBID Canada EAP
- 36 EAP for New Email Campaigns Experience in Blackbaud Luminate Online®
- 109 EAP for 360 Student Profile in Blackbaud Student Information System
- 41 EAP for Assessment Builder in Blackbaud Learning Management System™
- 9 Technical Preview for SKY API for Blackbaud CRM™ and Blackbaud Altru®
- 55 Community Advisory Group
- 46 Blackbaud Community Ideas
- 26 Blackbaud Community Challenges
- 7 Security Testing Forum
- 3 Blackbaud Staff Discussions
- 1 Blackbaud Partners Discussions
- 1 Blackbaud Giving Search™
- 35 EAP Student Assignment Details and Assignment Center
- 39 EAP Core - Roles and Tasks
- 59 Blackbaud Community All-Stars Discussions
- 20 Blackbaud Raiser's Edge NXT® Online Giving EAP
- Diocesan Blackbaud Raiser’s Edge NXT® User’s Group
- 2 Blackbaud Consultant’s Community
- 43 End of Term Grade Entry EAP
- 92 EAP for Query in Blackbaud Raiser's Edge NXT®
- 38 Standard Reports for Blackbaud Raiser's Edge NXT® EAP
- 12 Payments Assistant for Blackbaud Financial Edge NXT® EAP
- 6 Ask an All Star (Austen Brown)
- 8 Ask an All-Star Alex Wong (Blackbaud Raiser's Edge NXT®)
- 1 Ask an All-Star Alex Wong (Blackbaud Financial Edge NXT®)
- 6 Ask an All-Star (Christine Robertson)
- 21 Ask an Expert (Anthony Gallo)
- Blackbaud Francophone Group
- 22 Ask an Expert (David Springer)
- 4 Raiser's Edge NXT PowerUp Challenge #1 (Query)
- 6 Ask an All-Star Sunshine Reinken Watson and Carlene Johnson
- 4 Raiser's Edge NXT PowerUp Challenge: Events
- 14 Ask an All-Star (Elizabeth Johnson)
- 7 Ask an Expert (Stephen Churchill)
- 2025 ARCHIVED FORUM POSTS
- 322 ARCHIVED | Financial Edge® Tips and Tricks
- 164 ARCHIVED | Raiser's Edge® Blog
- 300 ARCHIVED | Raiser's Edge® Blog
- 441 ARCHIVED | Blackbaud Altru® Tips and Tricks
- 66 ARCHIVED | Blackbaud NetCommunity™ Blog
- 211 ARCHIVED | Blackbaud Target Analytics® Tips and Tricks
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- Luminate CRM DC Users Group
- 225 ARCHIVED | Blackbaud eTapestry® Tips and Tricks
- 1 Blackbaud eTapestry® Know How Blog
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
- 1 Blackbaud K-12 Education Solutions™ Blog
- 280 ARCHIVED | Mixed Community Announcements
- 3 ARCHIVED | Blackbaud Corporations™ & Blackbaud Foundations™ Hosting Status
- 1 npEngage
- 24 ARCHIVED | K-12 Announcements
- 15 ARCHIVED | FIMS Host*Net Hosting Status
- 23 ARCHIVED | Blackbaud Outcomes & Online Applications (IGAM) Hosting Status
- 22 ARCHIVED | Blackbaud DonorCentral Hosting Status
- 14 ARCHIVED | Blackbaud Grantmaking™ UK Hosting Status
- 117 ARCHIVED | Blackbaud CRM™ and Blackbaud Internet Solutions™ Announcements
- 50 Blackbaud NetCommunity™ Blog
- 169 ARCHIVED | Blackbaud Grantmaking™ Tips and Tricks
- Advocacy DC Users Group
- 718 Community News
- Blackbaud Altru® Hosting Status
- 104 ARCHIVED | Member Spotlight
- 145 ARCHIVED | Hosting Blog
- 149 JustGiving® from Blackbaud® Blog
- 97 ARCHIVED | bbcon® Blogs
- 19 ARCHIVED | Blackbaud Luminate CRM™ Announcements
- 161 Luminate Advocacy News
- 187 Organizational Best Practices Blog
- 67 everydayhero Blog
- 52 Blackbaud SKY® Reporting Announcements
- 17 ARCHIVED | Blackbaud SKY® Reporting for K-12 Announcements
- 3 Luminate Online Product Advisory Group (LO PAG)
- 81 ARCHIVED | JustGiving® from Blackbaud® Tips and Tricks
- 1 ARCHIVED | K-12 Conference Blog
- Blackbaud Church Management™ Announcements
- ARCHIVED | Blackbaud Award Management™ and Blackbaud Stewardship Management™ Announcements
- 1 Blackbaud Peer-to-Peer Fundraising™, Powered by JustGiving® Blogs
- 39 Tips, Tricks, and Timesavers!
- 56 Blackbaud Church Management™ Resources
- 154 Blackbaud Church Management™ Announcements
- 1 ARCHIVED | Blackbaud Church Management™ Tips and Tricks
- 11 ARCHIVED | Blackbaud Higher Education Solutions™ Announcements
- 7 ARCHIVED | Blackbaud Guided Fundraising™ Blog
- 2 Blackbaud Fundraiser Performance Management™ Blog
- 9 Foundations Events and Content
- 14 ARCHIVED | Blog Posts
- 2 ARCHIVED | Blackbaud FIMS™ Announcement and Tips
- 59 Blackbaud Partner Announcements
- 10 ARCHIVED | Blackbaud Impact Edge™ EAP Blogs
- 1 Community Help Blogs
- Diocesan Blackbaud Raiser’s Edge NXT® Users' Group
- Blackbaud Consultant’s Community
- Blackbaud Francophone Group
- 1 BLOG ARCHIVE CATEGORY
- Blackbaud Community™ Discussions
- 8.3K Blackbaud Luminate Online® & Blackbaud TeamRaiser® Discussions
- 5.7K Jobs Board