Quantcast

Joel Nagy .com

web technology is a way of life

MODx Math

Just found my self needing to implement an <iframe> into a MODx site, and since I wanted to have the <iframe> be part of the template I felt it would be best to have the src, width and height be template variables making the <iframe>’s appearance based on the content and not fixed. For my particular needs I was wrapping everything in a <table> that then needed to have a width slightly larger than the <iframe>. For this I came up with a simple snippet that evals a little equation forcing it to an integer to be safe:


<?php
// eg: [[math?math=[*iframeWidth*]+34]]

if (isset($math)) {
     eval("\$math = (int) ". $math .";");
     echo $math;
} else
     echo "0";
?>

So if [*iframeWidth*] is set to 550 and I have <table width=”[[math?math=[*iframeWidth*]+34]]“> in the template then the rendered HTML will be <table width=”584“>

Reblog this post [with Zemanta]
  • 0 Comments
  • Filed under: Code
  • Conversation Frequency

    In a similar vein to my previous concept of developing a better method for finding relevant products based on quality reviews and ratings I have thought of an idea for how to find relevant “conversations” and information that are available on blogs, forums and similar conversation centers.

    Currently information can be found through keyword searching, by date, or forum entries with recent comments. But none of these really shows true activity. On a blog, the most recent post or the post with the most comments are not neccessarily the ones that truly have the most qualified activity.

    Sometimes a forum post that’s years old will be commented on and rise to the top, a trick that is commonly used to “bump” a post to the top to gain undeserved attention.  Often there are posts on a blog that are heavily trafficed and have many many comments, especially if the post is old.  This commonly leads blogs to not allow comments on old posts.

    I recommend that blogs and forums should have an option to sort entries by activity.  Such a sort would take not just the recency or quantity of the comments but would use them together.  A point system could be used to rank posts based on the how recent the last post was along with how recent that comment was to the previous comments along with comments on comments (if that is a feature of the system.)  Other possible ways to add points to a post could be to add a rating system to posts and comments.

    How to search for content on a blog or forum that is not just “most comments” or most recently commented (this allows for posts that are extremely old but have a lot of comments from showing up high when the conversation is very spread out and allows for the “bump” issue to not be a problem by allowing posts that are just commented on by the poster to bump it to the top), but is more defined such as most frequently discussed.  By this I mean that finding discussions where the content is weighted by time since posted, and time span between posts.  An algorithm could be created based on the weight to determine a point value for the discussion that would then allow you to see what has the highest frequency.  This would allow you to know which conversations are currently very active.  For example if 75% of the comments are by the creator of the post then each point for the comments are low, but if there are considerable comments by others interspersed between the creators comments (thus illustrating a conversation) then the creators comments are weighted higher since they are adding comments of importance.

    I’m sure there are other potential ways to weight posts and comments, but at any rate a system of sorting by activity will allow you to find content that is currently important and has time sensitive relavance which often is quite important in a forum or any sort of social chating environment.

  • 0 Comments
  • Filed under: Thoughts
  • Rating Sorting that Works

    Ever go to a store such as Amazon and search for something and try to find the best rated product? I find that the rating sorting doesn’t accurately display products by consumer approval. Just having a high product rating shouldn’t list a product first when sorting by rating, especially if the product has 5 out of 5 stars rated by only one user.  And it seems that if only 1 of 3 people even thought it was a decent review that those 5 stars are not as reliable as they you would want them to be.  Sure you can blame the people who write them and then rate every review yourself, and then sort the reviews for each product by the most helpful reviews, but that’s a lot of work.  I feel that a more automated system that would add weights to each star rating and incorporate that weight to the total number of reviews and number of helpful reviews as well could acheive a formula that would allow for a more relevant list of products ordered by a logical rating that takes into account the quality of the review.

    I played with a few formulas before I arrived at this one, which I will state isn’t perfect, but you can get the idea.  And of course what you use as the weight of the ratings and how you apply the helpfulness will affect how many points are finally added to each product.

    POINTS = v * s + (y-n) * s
    v: number of reviews
    s: curved scale value for rating based on  5=25, 4=10, 3=1, 2=0.01, 1=0.005
    y: number of helpful review votes across all reviews
    n: number of un-helpful review votes across all reviews

    I did a search for “802.11n router” on Amazon and found the top six products ordered by user rating had a 5 star product with 1 review listed first.  After my system this is how those top six should be listed

    Amazon Rank My Rank Rating Reviews Helpful Votes Total Votes My Points
    5. 1. 4.0 4 Stars 344 1232 1663 11450
    6. 2. 4.0 4 Stars 119 567 793 4600
    2. 3. 4.5 4.5 Stars 12 34 41 780
    3. 4. 4.5 4.5 Stars 3 11   240
    4. 5. 4.0 4 Stars 4 0 0 40
    1. 6. 5.0 5 Stars 1 1 3 0

    Of course items that are older will have more reviews, but at the same time these items will also have reviews that will be rated by others that will properly let you know if something is truly rated high, not just the highest rated. Other possibilites are to make the formula more specific by multiplying the helpful scores by the rate they are marked for and not simply adding all the thumbs ups and thumbs down collectively as I have.

    Other considerations could even be taken involving the person that gave the rating. These could be extra points given to a rating by a person that has had a certain level of helpful reviews on other products, by this that could mean that a person that gives a 3 rating to a review would then possibly count as multiple 3s based on his level. In this example if “Bobby M.” reviewed 20 products all of which have received more than 100 helpful reviews with a 90% helpful rating then his vote could be counted as 5 votes instead of one as he is considered an “expert.”

    I think this is a good start into creating a more helpful way to present product ratings especially in a world were sorting and finding the perfect product is very difficult as more and more products flood the market.

  • 0 Comments
  • Filed under: Thoughts
  • Analytics Minus the Numbers

    I would like a web analytics platform that focused on the results of analysis and not the numbers. I came up with the idea of visitor profiles that could be used to gauge the high level understanding of visitors. Then when you want to truly understand your visitors you dive into the data along with your masters degree.

    My idea for profiles consists of grouping many data points into categories. Here are just 4 profiles for an average site, many more could be created based on the content and focus of the site. These profiles can be adjusted to look at data for the whole site or simply sections of it:

    Bouncer - The type of visitor that reaches your site and leaves immediately, something often seen when users visit from banners or paid search links. Less than 2 page views in 30 seconds or less.
    Browser - A visitor that wants to see everything on the site, yet they don’t stay anywhere long enough to actually intake the content. Views 90% of the pages on the site in less than 30 seconds per page (thus a site of 40 pages would consider a visitor a Browser even with a session of 18 minutes.)
    Enthusiast - Someone that really explores and gains something by visiting your site. Views at least 40% of the site, but also performs such actions such as viewing videos to completion, filling out registration/send to friend forms, downloads content (basically a visitor that interacts with the content.)
    Casual - This is the default bucket, they didn’t bounce, they didn’t try to surf the whole site faster than Michael Phelps and they didn’t interact a lot.)

    These profiles can then be used to determine how the site is being used as a whole. So if your site launched a new feature and Bouncers increased overall or simply in that section then you need to look into why that happened. Or if changed your layout or navigation flow or appearance and Browsers weer the most popular profile, then you could establish that visitors were just trying to understand the new flow or were even lost trying to find the content they wanted. What you gather from the results may be speculative, but I’m sure it’s more than knowing that 1,675 visitors viewed 1.37 page views per session.

    UPDATE: A while ago I found Quantcast and found it interesting but at the time it didn’t have a very significant base of data.  But now that the company is a few years older, and to complete some more research into the space of Web Analytics I came across them again today.  They have on their site a similiar concept to my ideas, that they label “Site Frequency”.  I think this is right direction and should be something that they should expand on and make more prominent in their dashboard of data.

  • 0 Comments
  • Filed under: Thoughts
  • In Other News...