Click to Play

Search Marketing Evolution
As search has developed, the end user has also undergone behavioral changes. Universal and blended search have played a lead role in the user’s changes. Many...

Web News

Using Canonical URL Tags On Your Site
Last week we learned of the magical new Link Element which was announced at SMX West which was purported to resolve a longstanding problem with duplicate content by pointing search engines to a single URL for...

Four Influential CSS Development Resources
I have a lot of web design books - I mean a lot. I've been collecting them since I started Red Kite in 2005, and I thought this would be a great place to share which ones have been most useful to me as a designer...

Improving The Important Aspects Of SEO
There are so many SEO tasks demanding your attention. How do you prioritize them? Seems to be a common issue, as when we asked for questions a...

Keeping Your Link Juice With Correct Redirects
This DIY tip was inspired by an issue we actually encountered during the week with one of our own redirects. Unfortunately one of our redirects had stopped working without us realizing, for some unknown reason.


03.16.09

Understanding The Use Of Omniture’s Token System

By Gary Angel

In my next post, I'm going to dive down and talk in more detail how the API actually works and show pieces of a real application. But before I go there, I wanted to touch one more time on tokens and give any programmers out there a heads-up on the "Great Token Gotcha."

In my last post, I described Omniture's token system - the basic metering systems that controls how many API requests you can make and how they cost. In essence, each API request you make costs you a token. And to use the reporting API, you have to submit a request and then you have to get the report. So you typically use two tokens per request.

Simple?

It is, but there is a big gotcha out there.

Here's how it works.

To make a request to the API, you build up a report object that tells Omniture what data you want to retrieve and what time period you are looking for. When you've defined everything, you submit your report.

So far so good.

Now here comes the tricky part. Most Omniture Sample code works the same way. After the request is submitted, you go into a wait loop. You pause your program for a second or two, request the report object to see if it's finished. If it's done, you are good to go. If it's not done, you wait for another second or two and check again.

The Premier Event for Search Engine
Marketing & Optimization -
Register Now

Here's some heavily commented code (this whole post is really for programmers so feel free to skip if your interest in the API is more on the business site):

//request the report
reportQueueResponse response = glob.ws.ReportQueueRanked(rd);

// Wait for 1000 milliseconds or 1 second
System.Threading.Thread.Sleep(1000);

// Grab report
reportResponse reportR = glob.ws.ReportGetReport(response.reportID);


// If the report is not ready then wait and check to see if it is ready
while (reportR.status != "done")
{
// Wait another second
            System.Threading.Thread.Sleep(1000);
// Check the report again
      reportR = glob.ws.ReportGetReport(response.reportID)

// Keep checking (go back to the while until the reportR.status is done
}

This is a simple, obvious way to manage your code. There are others, but this is the way most of the Omniture examples on their dev site are built and it makes perfect sense.

It's also terribly wrong and the reason isn't programmatic. What is hidden in the system is that Omniture will dock you a token for each and every time you make the:

Continue reading this article.


About the Author:
Gary Angel is the author of the "SEMAngel blog - Web Analytics and Search Engine Marketing practices and perspectives from a 10-year experienced guru.
About DevWebPro India
DevWebPro India is for professional developers ... those who build and manage applications and sophisticated websites. DevWebPro India delivers via news and expert advice New Strategies In Development.





DevWebPro India is brought to you by:

SecurityConfig.com NetworkingFiles.com
NetworkNewz.com WebProASP.com
DatabaseProNews.com SQLProNews.com
ITcertificationNews.com SysAdminNews.com
LinuxProNews.com WirelessProNews.com
CProgrammingTrends.com NetworkNewz.com





-- DevWebPro India is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
2009 iEntry, Inc.  All Rights Reserved  Privacy Policy  Legal

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article


New Strategies In Development DevWebPro India News Archives About Us Feedback DevWebPro India Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact