December 3rd, 2009 admin Location: Raleigh, North Carolina
In this episode Alex Centeno MBA. from Merkados, shows you how to install the necessary code to retrieve the IP addresses of your visitors using Google Analytics.
This online marketing technique can be modified to be used with other scripting languages other than PHP, however, in this case, the languages used are PHP and Javascript. Read the rest of this entry »
Posted in Online Marketing Tutorials | Comments Off
September 3rd, 2009 admin Location: Raleigh, North Carolina
Hey there… I have been testing this new technique that I wanted to share with our readers. Sometimes you have a website that requires some dynamic loading of its background. An example of usage could be a surfing website. Depending on the forecast or tide, you could parse the xml information and display a different background in your surfing site. So when a user arrives to the site automatically knows if it is a surfing day or a sleep-in day… You get the idea!
Anyways, the code is fairly simple in php and I am sure you can translate this fairly easily to other languages out there.
First you are going to setup the php page that handles the dynamic nature of the background image. For example, create a file named: back.php and then add the following to it:
/*Comment of Code*/
$now = date(a);
if($now == 'am') {
$img = "morning.jpg";
} else {
$img = "night.jpg";
}
$contentType = 'Content-Type: image/jpeg';
header($contentType);
readfile($img);
/*End of Code*/
The above code says: “Check the time of the day, if is am – then change the image variable to morning.jpg, if it is pm, then change the image variable to night.jpg. Then change the content-type of the document to image/jpg.
That is it. Then, you go into your site’s css stylesheet and add the following:
/*CSS Code*/
body {
background: url('back.php')no-repeat;
}
/*End of Code*/
And that should do the trick. If somebody visits the page in the morning, then background morning.jpg is used, if somebody visits the page at night, then background night.jpg is used.
Obviously this is a over simplistic example of what can be accomplished with this technique. You can set up backgrounds with animations in GIFs. You can dynamically control the opacity of your background depending on time of day for a better experience for your visitors. You can detect the location of the users and change the elements of the page to show a more customized page to them.
For example: In landing pages for your Google Adwords ads, you could detect the location of the users and if they are in let’s say New York, they would land in a page with a background of the Statue of Liberty, however if they visit from Vegas, they could have the background of the Bellagio Fountains.
The possibilities are endless, and as always, you don’t have to use it in every project! Take this technique and put in your bag of tools. When the time is right, you’ll know it.
If you have any questions or you need custom website design, please visit Merkados. Perhaps we can help.
Posted in Design Tutorials | No Comments »