Drupal 7 SimpleAds Module

By shane
Tue, 2012-09-11 15:43
13 comments
Daily Dose of Drupal Episode #5

Have you ever wanted to display advertisements on your Drupal 7 website? If so, this episode will walk you through step by step, how to set up and configure text and image advertisements for display on your Drupal site using the SimpleAds Module.

In this episode you will learn:

  • How to install and configure the SimpleAds module on a Drupal 7 site
  • How SimpleAds campaigns work
  • How to display text based advertisements on your Drupal 7 website
  • How to display image based advertisements on your Drupal 7 website
  • How to view analytics and performance of the advertisements

Hello there Drupal developers and today we have another episode of the Daily Dose of Drupal, brought to you by codekarate.com. Today we are on episode number 5. Today we’re going to be covering advertisements using the Drupal 7 Simple Ads module it’s available on drupal.org and we’re going to be using the 1.8 version.

So we’re going to go ahead and jump over to our test Drupal 7 site and the first thing we’re going to do is download the Simple Ads Module. So I’m going to hop in to my command line and using Drush I’m going to download Simple Ads. I can see it contains two modules; Simple Ads module and Simple Ads Campaigns.

We’re going to hop over to our site and go into the modules page, scroll down and find Simple Ads. You can see it has Campaigns and Simple Ads, we’re going to go ahead and use Campaigns so we can show what that looks like and how that works, so I turn both those on and now we hit the Save configuration button and it is now saved.

If we scroll back down you’ll see that there are some Permissions here so if I go to the Permission’s page you can see that there are permissions for Access Advertising Campaigns, that would be for anyone needing to manage the campaign and there are also some Simple Ads permissions. Count Ad Impressions and Count Ad Clicks are important so if you wanted your authenticated users to also be counted in the advertisements you can check those, hit Save.

So the next step is going to be actually creating Campaign and a Campaign is just a grouping of Advertisements. So in this case we’re going to create a campaign for codekarate and this is going to contain a couple of different advertisements and you can select what you want to track. I’m just going to track Clicks and I’m going to say one Click is all I want this campaign to have so we can show what’s going to happen. We’re going to start now and there’s a couple of different things that you can do to select what type of date, whether you want to start tomorrow or a week from now or a specific set date.

One important thing you’re going to need to look at is the Publishing Options and actually make sure you publish this otherwise it’s not going to show up so let’s go ahead and hit Save after we checked that Publish button, now we have our Codekarate Campaign.

The next step is going to be adding a few different advertisements. I’m going to add the first one as a Text Advertisement, call this Codekarate Ad 1 and we’re going to say it’s in the Sidebar Ads. For a Text Advertisement if you wanted to track Clicks you need to use Plain Text. I’m just going to say “Check out Code Karate” and you put in the URL, we’ll go ahead and leave the Active Dates, everything at its default and now we select the campaign we want to show up on there so we could select codekarate … again here you have to make sure it’s published or it will not show up, so we save that, we’re also going to add a quick Image Advertisement, I’m not exactly sure how this is going to look, I haven’t really changed the image dimensions at all, we’ll call this Code Karate Ad 2, we’ll put this on the Sidebar Ads as the Ad group, this is the Image Ad, we’ll select Code Karate basic logo there, enter the URL, select the Campaign, the Advertisement is active and again we’ll hit Publish.

Now we have one Campaign with two Advertisements in it; let’s go ahead and take a look; if you’ll go to content you’ll have two new options up here; one for Ads List and one for Ad Campaigns. The Ads List are the Ads that you have available and it shows that it’s in the Code Karate Campaign, you can view Statistics for each Advertisement, it tells you the Clicks and Unique Clicks as well as Impressions and Unique Impressions, you can also edit and delete from that Ads List and the Ad Campaigns shows you all the Campaigns you have, how many Advertisements are in that Campaign, what the limits that you have set are and you can then view that, edit or delete it from there.

So what we’re going to do is we’re going to go ahead and add this block; there are a couple of blocks there that you can use, there’s Advertisement block for Content Ads and Advertisement block for Sidebar Ads. We’re going to add this to the first Sidebar since we added it to the Sidebar Ads group and I’m going to throw it up on top of the Sidebar, I’m going to hit Save.

Now I’m going to hop over to another browser where you can see I’m on test.codekarate.com, if I refresh you’ll see I now have an Image Ad that shows up. And when I hover over this; if you look down at the bottom you’ll see that it’s actually sending me to a link on my test.codekarate.com site and it’s going to use the Simple Ads module is going to then track that Click and redirect me to wherever I said I wanted this to go.

So if I go ahead and click here it opens up in a new window and then it brings me to the codekarate.com website. So if I refresh again I now have check out Code Karate, if I refresh a couple more times you’ll notice that I’m only getting that Text Advertisement now.

The Image Drupal advertisement is not showing up so if we hop back over here we can find out why. I’ll go into content, go into the Ads list and you’ll see that Code Karate Ad 2 which was that Image Advertisement is not published and is now inactive. And this is because we set our campaign limit at one click. After one click; any advertisement in that campaign is going to become disabled. If we hop back over and we click on the Tex Advertisement it opens up the Code Karate website again and now there are no Ads because it was then deactivated. So if we refresh here you can see that now none of these advertisements are published, you can go ahead and look at the statistics shows that there are 6 Ad Impressions, only one Unique Impression and it breaks it down into today, yesterday and a couple of different date ranges and then we only had one Click. And that’s all there really is to the Simple Ads module, at least getting us set up basically.

There’s also good integration with Views so you can modify the advertisements and what’s displayed using the Views module, you can also, using the Advertisement filter which I will show you where that is quickly. Inside the Filter the full HTML and you can add a Filter for a simple Ads Filter which will allow you to insert advertisements directly into your content.

So if you had specific pages that you wanted specific advertisements to display, you could use that filter just by turning that on and adding this little piece of code and there’s a little bit more documentation on that I believe on the Simple Ads page. So that’s it for this time, if you are interested in learning more check out the other Daily Dose of Drupal videos and be sure to follow me on Twitter @smthomas3 and check out my other posts on codekarate.com. Until next time, thanks for watching.

5 Secrets to Becoming a Drupal 7 Ninja

Comments

Hi, nice tuto, but i got a problem. I follow all the tuto, step by step, and my image ad don't redirect to the URL, i can't click on it , i tried with some differents URL but the problem still the same. when i explore the element, the href redirect me to the node for modify my ad.

Do you know how can i fix that ?

PS: I Tried to logout or open my page in a new browser but my img is still non-clickable

a link to moduals would be nice as there are 2 but only if u use something called drush? then there is one and no others mentioned apart from this vid :)

ps link to a demo?

Would it be too hard to briefly explain how to set it up to show specific campaigns based on selected section on site?
e.g. if you are on Cars section of site, you have rent-a-car ads, and if you are on Motorbikes you have ads for shops that sells them.

Btw, great brief explanation of this potentially powerful module. Great job!

Hi, me again... Im quite new with Drupal, and coming from other CMS complete Drupal logic to me is skewed so I need help with something.

What I am trying to do is to show Ads block on right side, template name i believe is views-view--sidebar_posts.tpl.php which is based on current taxonomy of page/article. E.g. if I am on Cars page, or any other article that have Cars taxonomy assigned I want to show one block, while if I am on Motorcycles page or any other page that have same taxonomy assigned I want other block of commercials to show.
Now, I have added another field to Ads content type where I can assign where do I want them to show, but there is no way for me to do views/blocks/coder or WHATEVER to show them on my pages.
ANY help is much appreciated...

Thanks in advance

Thanks, excellent tutorial. It was just what I needed to get the module configured and up and running in minutes!

I created a campaign, and triple checked it was published, but when I go to create an ad, as per the tutorial, The campaign selection box just has '-NONE-' available, and not also the name of the published campaign.

When viewing the various items under content, I can see that I have an Advertisment Campaign and an Advertisment and they both show as published.

I'm using version 7.x - 1.8

Any clues what I'm doing wrong?

Hi,
thanx for the great video!
We have a multilingual site, and each time we add an Ad, it's considered by drupal as "english" language content, since there is not field to select the language in SimpleAds. So, the Ads are displayed only in the English site version.
Is SimpleAds working with more than one language?

hi,
i have install simpleads module in drupal 7.22
and i flow all tutorial.
But i my ads ís not display.
Please help me fix it.
Thanks

Hello,

The Simple Ads campaign works if it is set to one click but when I want two clicks then it does not work anymore. Can you please help me on this?

Thanks.

Hi,
Thank you for your efforts. I am new to drupal. I installed simpleads module and enabled it in drupal 7. (ver1.8).
full permission given to administrator. logged in as administrator but in content no fields are displaying (i.e. Ad type, Ad Group etc.) only the title field appearing.
checked the content type/simpleads/manage fields there also no fields
in taxonomy there is a vocablulary called Ad Groups with terms Content Ads & Sidebar Ads
in view - shows an error message : Display "Master" uses fields but there are none defined for it or all are excluded

may be I didn't get the way.....
Please help me

Regards
Abdul Gafoor

Post new comment