Hallo

On my site clicks on html-ads are not counted. Clicks on image-ads are counted properly. Is this normal behaviour or a bug?
Thanks
Carsonh

CommentFileSizeAuthor
#7 enabletrackingofclicks.png34.23 KBliam mcdermott

Comments

jeremy’s picture

Category: support » feature

This is by design -- currently, the ad_html module simply allows you to paste in a blob of html which it then serves as an advertisement. Because of this, it's unable to track the various links within the advertisement, and has no way to determine if they were clicked.

One solution would be to add additional logic to the ad_html module to parse the HTML snippet, extracting all the links contained (ie, with regex). These links could be moved into a database table and replaced with ad-module-style links allowing tracking. Thus, when a link within the html snippet was clicked, the the user would be taken to the ad modules redirect page. The click would be recorded, then the user would be redirected to the intended destination (all of this invisible to the person clicking the ad).

Certainly do-able, but as I have no need for this it's not currently high on my priorities. Marking as a feature request, awaiting a patch, funding, or spare time.

jeremy’s picture

Status: Active » Postponed

Postponing until someone contributes a patch.

dbirider’s picture

I'm not good enough to create a patch, but it seems like a simple solution would be to give users an option of entering the destination url, then telling them to manually enter the /ad/redirect/#/ url if they want their clicks tracked.

Encarte’s picture

subscribing

inforeto’s picture

subscribing

yes, allowing a destination url would be an useful option.
it should be optional, leaving the field blank for those ads that have external links.

sonlinemedia’s picture

Subscribing

liam mcdermott’s picture

StatusFileSize
new34.23 KB

Not sure if this helps. but OpenX has been able to parse HTML links for a few years, screenshot of the interface is attached FWIW.

Grepping through the source of the latest release, the regexp's used are in www/admin/lib-banner.inc.php OpenX leaves the link intact and inserts {clickurl} before it, I believe it uses the URL as an argument for the click-thru script. For example, a URL of http://www.opera.com becomes http://www.example.com/ads/www/delivery/ck.php?oaparams=2__bannerid=54__...

Note that the {clickurl} is str_replace()'d in MAX_adRender() in lib/max/Delivery/adRender.php

I would advise anyone who urgently needs this feature to switch to OpenX, or give Jeremy some cash to implement it in the Ad module (roughly how much would it cost Jeremy?)

sgdev’s picture

Actually I'm curious to know too... how much do you think it would cost for you to implement this Jeremy? If there are a few people wanting to get this done, maybe we could get everyone to chip in.

jeremy’s picture

Version: 5.x-1.4-1 » 6.x-2.x-dev

Well, we'd either have to modify the ad module to support embedding the destination in the click URL (which means we'd also need to implement some sort of validation to prevent arbitrary click through abuse), or we'd have to store the destination URLs in the database as I described above. The actual regex is fairly straight forward. Unfortunately, however, I've got too much work on my plate to take on this job in the short term.

g10tto’s picture

Subscribe.

With all respect toward Jeremy's and the other developers' time, this seems like a pretty high priority feature request, given the age of the module and lack of alternatives.

For all that Drupal's helped my company's business, I'd be willing to chip in for sure to get this solved today.

inforeto’s picture

The old banner module used to do this with something like /banner/nodeid.
This way you can create the banner knowing the nodeid in advance.

edgoss’s picture

Agreed, this should be a top priority. While most sponsor programs allow you to manually download the image files, thus allowing us to use the image ad module, some do not. One good example is commission junction, which is one of the biggest ad brokers around.

Analytics to measure click-through ratios is a must for any ad campaign. Without it I have no way to improve my campaigns.

I'd be willing to chip in for this feature.

http://www.plentyoffishtales.com

inforeto’s picture

About the url path, ad/redirect/nodeid (like ad/redirect/22440) is already counting the clicks on html ads so all that is left is to use the existing redirection code with the entry to capture the link on html ads.

bnishant’s picture

hi all,

Can anyone please tell me where can i set "clickurl" ? My project is stucked at this point so please inform me as soon as possible.

Thanks in advance .

inforeto’s picture

Currently there isn't a form to capture the url in the ad form.
The code to count clicks exist but the code to redirect to the stored url must be added.

karensmallwood’s picture

Has anyone found a solution to this yet?

I have a real problem with flash ads in so much as I can't set the wmode unless I do it in the embed code and without the wmode set as transparent the nice menu drop down slips behind the flash ad.

I am using the html ad version to resolve this but then I can't track clicks.....any ideas anyone???

karensmallwood’s picture

Status: Postponed » Needs work
igorik’s picture

subscribe, there is no option how to track click on html ads and the module doesn't warn you, only shows 0 clicks.

liam mcdermott’s picture

Status: Needs work » Postponed

Resetting status, please don't mess with it if you don't know what the statuses mean. :)

Anderskj’s picture

Subscribing

macrodesign’s picture

subscribing

obiwankaynobi’s picture

subbing

inforeto’s picture

@karensmallwood:
To add the full functionality someone need to contribute the various pieces of code (input fields, etc.).

Meanwhile there's various workarounds.
A simple one might be using two ads, the html ad to show the banner and a hidden image ad to track the pageviews and clicks.
The url to use in the flash ad would be that of the image ad, in the form of /ad/redirect/(node)/0

Encarte’s picture

That's an interesting workaround inforeto. Won't it bring SEO problems with goggle and stuff?

inforeto’s picture

The ads load via javascript, but if it's an issue then don't print the image ad.
You'll have to track the pageviews on the html ad and the clicks on the image ad separately.

gennadiy’s picture

Hi guys,
If you OK to add "DESTINATION URL:" directly to the database, then this is an elegant solution to the problem:
1) alter ad_html table in your drupal database to add 'url' field as per ad_image.install:

      'url' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),

2) insert this PHP code:

case 'redirect':
      return db_result(db_query('SELECT url FROM {ad_html} WHERE aid = %d', $node->nid));

into ad_html.module right after line:

case 'view':
      return ad_html_node_view($node);

3) after your HTML ad is created insert the link to redirect into ad_html table's url field

4) click on the link in form of /ad/redirect/xxxx/txxxx (used inside of your HTML ad's HTML code) will be counted and then redirected to the right url.

UPDATE: You may be interested in this Case Study too: HTML5/Flash Ad Case Study

Hope this will help,
Gennady

LukM’s picture

Subscribe

WeRockYourWeb.com’s picture

Subscribing.

lrwebks’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

Drupal 6 is EOL and no longer supported. Closing this as outdated for that reason. Thanks for your contribution!