have you ever wondered how site value script or webmaster tools get your Alexa ranking number? , Well it nothing fancy or complicated justing using the existing Url parameter from amazon Alexa ranking to access your domain rank using PHP .. which involves about XML and so many complicated stuff but in this post, I’m not going to go into ‘ How to ‘ space.
so first you create your function to define your two variables which is
$formatwell in this post we won’t go into formats so it will be set to false since I’m not diving into deep Analytics. Then the rest will be history but this is the snippet.
this is the code I used o my home page to get my Alexa ranking for sure it has no use to my site but I want to see how my name is ranking on the web which is bit childish.. 😉
The second snippet I used was the pageviews count basically this will count every time you refresh the page and I’m not sure if it’s based per browser but I’m here to find out. but my Goal was to Insight plugins functions or variable and be able to display my monthly page views which didn’t work since I can find that out so instead, I used this snippet.
lastly, it was the post count which is really the simplest thing to do from any script you might be using … In my case since this is WordPress, I used WP functions according to thecodex reference