KeyAds Module For ExpressionEngine

by Kyle on · Posted in ExpressionEngine

KeyAds is a module for ExpressionEngine that allows you to display content to your visitors—like an ad or block of HTML code—based on keywords they enter in a search engine, or based on the referring domain.

Installation

To install KeyAds, download the latest version and upload it to your root web directory, usually public_html or httpdocs.

Once downloaded, unpack the archive. The unpacked file structure is as follows:

keyads/language/english/lang.keyads.php
keyads/modules/keyads/mcp.keyads.php
keyads/modules/keyads/mod.keyads.php

Move lang.keyads.php to:

<system_folder>/languages/english/

And move the entire keyads module directory to:

<system_folder>/modules/

Once you’ve done this, login to the backend of ExpressionEngine and go to the Modules section. Click on the Install link.

After the module is installed, click on the KeyAds link to access the interface.

Create Ad Group

Since no ad groups will exist, you will need to click on the New Ad Group button.

You’ll be asked to enter a Title and Description for your ad group, try and make it something descriptive.

For our testing purposes, we’ll make an ad group called Code Snips.

Once the ad group has been created, click on the title of the ad group from the main page to create a new ad for this group.

Create Ad

To create an ad, click on the Create Ad link. You’ll be asked for the following information:

Title

The title for your new ad.

Description

A brief summary for your new ad. This is optional.

Target

You’ll have two options here, either Keyword or Domain.

By default, Keyword is selected. This will check the referring site for keywords that you’ll enter in the next step.

If you choose Domain, you can enter one or more referring domain names to show this ad for.

Keywords / Domains

Enter one or more keywords or domains in here. This is what will trigger the ad if the referring site matches what’s in here.

Code

You can put anything in here, but it’s probably going to be HTML. For example, you could show an image ad or maybe a text box.

Once you’ve entered in everything, click the Edit button.

Showing Your Ad

Showing the ad is easy. Open up the template that you want to show ads on, and paste the following in:

{exp:keyads}

That’s it! If KeyAds matches the target and keywords or referring domain that you entered in the KeyAds interface, your code will show up wherever you placed this tag.

Example

So here’s an example of how this works. First, here is what the page looks like normally:

http://www.crucialwebhost.com/blog/you-are-here-using-php-to-highlight-navigation/

Now, to see the same page with our new block of code, go here:

http://www.google.com/search?q=php+active+navigation

The first result should be ours. If not, look for Blog › You Are Here: Using PHP To Highlight Navigation. Once you find the link, click on it. You should see the ad in a yellow box towards the top of the page.

Here’s a comparison image as well:

Download

You can download this module for free here:

http://ee.cwhapps.com/modules/keyads/latest.zip

Save. Share. Submit.