Using AJAX and PHP to Create Page Content Linked to Keywords in URL
This article is designed to give an overview of the processes involved in creating context sensitive content that is designed to generate revenue. It is important because no content-oriented site can exist just be serving up information; they have a need to sell something to support this activity.
The trick is to:
- Create themed content
- Isolate key phrases that buyers use to find products
- Give the buyers information
- Sell them what they want to buy
This last is where the context sensitive content model comes into play, as products can be selected from any online vendor that supports XML or HTML query-response mechanisms (such as REST). If the correct keywords are supplied, then the result will be a selection of products that the visitor will want to buy.
The content leads to higher page views, and the dynamic content leads to higher conversion rates.
Context Sensitive Content
The dynamic content being served can be linked to one of two mechanisms:
- linked to keywords within the content (AdSense model)
- linked to tags and queries in the URL (ad-hoc model)
The first is the Google AdSense model, which populates advert panels with adverts reflecting the keywords found in the text. The second uses a technique that relies on the organizational model of the underlying content management system, although some ad-hoc implementations might also use the HTML head section meta tag containing the description or keywords.
If the dynamic content is linked to keywords on page (or in meta tags) and if those keywords are buyers keywords, then income can be generated through PPC adverts or affiliate sales.
Placeholders & Integration with CMS
Other data sources for affiliate products and services include:
- Amazon via REST interface
- XML & RSS Feeds from providers such as YouTube, eBay, etc.
- Mashup providers such as Yahoo! Pipes & Feed43.com
- Specialized API such as Google’s GDATA
All of the above provide at least a basic API which can be used as a straightforward HTTP call, which might look something like the following:
If PHP is used on the backend then the incoming XML can also be processed using PHPs SimpleXML (as described in the PHP SimpleXML Blogger Syndication article). The advantage of this approach is that the feeds can be filtered to match the exact keywords being targeted, or several feeds merged together in a Yahoo! Pipes style mashup.
As long as the result is correctly generated HTML, then it can be displayed using the AJAX mechanism discussed in the Placeholders section of this article.