If I create a Channel that restricts selected ads "Display advertisements on every URL except the listed URLs" and use as the URL. So this channel will not display on the front page.

The result is this channel is the only ads that will be displayed, everywhere!

If I select "Display advertisements only on the listed URLs" with as the URL.

This channel is never displayed anywhere?

Whats up with this?

thanks, Scott

Comments

sderrick’s picture

The URL is "front" with <>

Not sure why that doesn't show up

eelkeblok’s picture

Probably because it is considered an (unallowed) HTML tag which is filtered out. You might try
&lt;front&gt;
<front>

Edit: hey, it worked.

benmmc’s picture

I'm having the same issue, but my url is one relative to root.

tetramentis’s picture

It looks like I'm experiencing the same issue, with custom 'everywhere' channel configured to 'Display on all pages except listed', and no URLs. In my case, this could be the interference of ads_by_taxonomy patch, so I'm still looking into that.

Update: my problem was indeed due to a bug in ads_by_taxonomy.

sderrick’s picture

Sure would be nice if the problem could be fixed or a hack work around found?

BarisW’s picture

I'm having similar issues where the channel paths only work for fixed url's.
So: http://ww.domain.com/news works, while http://ww.domain.com/news/* doesn't.

Could it be possible that the * is filtered out?

Anderskj’s picture

subscribing

Cannot get channel paths (urls) working in any way in 6.x-2.2. Did anybody find a workaround? I'm using clean URLs and pathauto.

alan d.’s picture

I think it would be best to use the Drupal way of doing this. I just found out the the following has no effect:

admin
admin/*
node/add/*
node/*/edit

on a 8 domains (using domain access), this will make the module very unwieldy

It would be very easy to refactor the code from the block module:

block->visibility == 2 is for PHP eval, a great additional feature but should have a permission set to it or it becomes a security issue. ("use PHP for channel visibility")

<?php

        if ($block->visibility < 2) {
          $path = drupal_get_path_alias($_GET['q']);
          // Compare with the internal and path alias (if any).
          $page_match = drupal_match_path($path, $block->pages);
          if ($path != $_GET['q']) {
            $page_match = $page_match || drupal_match_path($_GET['q'], $block->pages);
          }
          // When $block->visibility has a value of 0, the block is displayed on
          // all pages except those listed in $block->pages. When set to 1, it
          // is displayed only on those pages listed in $block->pages.
          $page_match = !($block->visibility xor $page_match);
        }
        else {
          $page_match = drupal_eval($block->pages);
        }
?>

Cheers

janar’s picture

Is there any easy fix at moment?

anonymous07’s picture

Subscribe. Same issue, even with 6.x-2.x-dev

welly’s picture

Subscribing.

Having the same issue. If the checkbox in the URLs section is set to "display ads on every..." then the ad displays regardless. If set to "display ads only on..." then the ads don't show up at all.

anonymous07’s picture

Any update on this?

What's the bounty necessary to get this done? Maybe the community that can't code can contribute. But, it would be nice to $ vs ETA.

IMHO, this is key functionality for this module.

anonymous07’s picture

Alan D.: Can you elaborate any further on what you think would need to be done to get this working i.e.,

"It would be very easy to refactor the code from the block module:"

I am looking for a way to get this working because this is key functionality for this module.

Thanks in advance

alan d.’s picture

As per comment #8. This module uses its' own block configuration, which differs from the above.

anonymous07’s picture

OK, so is there an easy way to implement the other block configuration "as per comment #8"?

gennadiy’s picture

Ad will not show on the page defined for the channel ("Display advertisements only on the listed URLs"), but will do if you add 2nd channel that has "Display advertisements on every URL except the listed URLs" rule. And will stay on the page, even after page was added to the "except" list for the 2nd channel.

I couldn't get debug info, as there was no that url code on the page when ad is not shown.
Thank you!

john franklin’s picture

There is a patch in #511200: <front> not working on channel settings that makes ad honor the <front> tag.

I'm not able to reproduce the wildcard issue described above. I have an ad in a Blogs channel set to only allow ads in the list below, and it works as expected. No other channels are defined.

blog
blog/*

Does anyone have debug info?

anonymous07’s picture

UPDATE: Per this note that I posted for #511200: <front> not working on channel settings, I sent the Debug info ... this still does not work for me.

I'll send you some debug info over the weekend.

This has never worked for me and I have numerous Ads and Ad Groups (in fact I started to use unique Ad Groups instead of having any Channels).

PS Thanks for working on this!

anonymous07’s picture

Some findings:

I tested Channels again to give John some feedback. When it didn't work for me, I deleted the channels.

Now ads that I modified to test with channels and new ads won't display.

When I look at the html source, I see:

http://www.example.com/sites/all/modules/ad/serve.php?q=1&amp;k=85dcd8db1455dbdbbc2ec93c61ec843d&amp;c=file&amp;f=15&amp;p=files&amp;t=381&amp;u=admin%2Fcontent%2Fad%2Fad_remote&amp;l=admin%2Fcontent%2Fad%2Fad_remote

When I try the url, I get:
document.write('\x3c!-- No active ads were found in 0 --\x3e');

And there are definitely ads there.

I even upgraded to latest 6.x-2.2 and applied the patch in #57 here #597116: ad module not displaying ad; same result.

I posted this here because I really believe it is related to Channels.

EDIT: BTW, I did change the & to & in the url above and it returned what should be an ad but they still aren't showing.

RedBob62’s picture

Version: 6.x-2.2 » 6.x-2.x-dev

I have no solution to the problem but am adding my experiences in case they help.

I have some product pages where I only want ads relating to those products to appear. I have other general pages where any ads can appear, including those which are displayed on the restricted product pages.

My first steps were to:
a) Modify the URL alias of the product pages by adding a product specific code (e.g. adgp6).
b) Create a channel for those product ads, selecting 'Display advertisements only on the listed URLs' and entering *adgp6*

This worked fine with the right product specifc ads appearing only on the right pages.

My next step what to try to get the product specific ads to appear on all other pages, other than other product specific pages and to do this I:

c) Created another channel with 'Display advertisements on every URL except the listed URLs' selected but then listing the URLs of the pages I did not want the ads to appear in (e.g. adgp1, adgp2 etc). As a test I also put in some standard pages such as 'aboutus' and 'contact'.
d) Added the new channel to the existing product ads.

The good news is that the ads appear in most other pages as required and were blocked from the 'aboutus' and 'contact' pages I had inserted for the test. However the ads also appeared in the other product pages which featured adgp1, adgp2 etc in their URL which is incorrect.

I have tried a variety of different approaches to excluding the required pages including:
- Posting the full address including domain (i.e. http://xxx.com/content/adgp1
- Posting just the product code (i.e. adgp1)
- Posting the code with '*' (i.e. *adgp1*, /adgp1*, /adgp1/*

I do not think the use of the URL alias is the issue because this same approach worked when I used it to restrict the display of ads on a given page.

None of them have worked. This is a huge problem because it makes the channel functionality almost pointless.

Sorry I cannot help more but hopefully it sheds a little more light on the problem.

anonymous07’s picture

@RedBob62: IMHO, any bit of additional insights is definitely helpful. Thanks for sharing this I might try it as well.

But I understand what you are saying -- Channels (for me) is one of the most desirable features of the module. And I think a comment mentioned earlier in the thread about "refactoring" the Drupal Block visibility code to apply here makes a lot of sense. I have looked at the code but I am not there yet in being able to solve this on my own. But I will test the heck out of anything someone submits to fix it. :-)

FWIW, I am also willing to contribute to a bounty to get it solved.

And for now I am still trying to get the ads to show since testing and removing Channels ... the Ad groups I modified while testing the Channels still will not show :-( the existing Ad groups that were not modified are showing just fine.

RedBob62’s picture

@annonymous7: Sorry to hear you are still having problems getting back to square one. Have you tried going in to the channel settings and changing the 'Display advertisements not assigned to any channel' to 'always' or at least ensuring it is not set to 'never'.

I am afraid there is little I can add regarding "refactoring the visibility code" given that I am a meer marketing bod so login on is about the limit of my technical know how :-)

As a quick update I have given up on channels for now and resorted to using groups. I have used a similar approach to that I previously described except that I have specified where the groups appear via the block configuration. This approach recognises the modified URLs with no problem. The only draw back is that it is not possible to allocate an ad to more than one group. This means you have to set the ads up twice, once in group with a block which only appears on the specified product pages and once in group with a block which appears on every page other than those relating to any other specified product. This does impact the internal MI and double up the ad set up effort. However, it looks like it works and at least means I can use the other functionality of the advertisement module.

Cheers

anonymous07’s picture

@RedBob62: Yes, the first thing I did (after deleting the 2 test channels) was change 'Display advertisements not assigned to any channel' to Always. I also even disabled the Channel module.

I also have a backup copy of the Ad code/modules so I will probably revert to the older Dev version I was using when things were working fine (I had applied some patches there).

My workaround for Channels is similar to what you described, except simpler (I think):
Use specific Ad Groups for certain types of ads.

Banner 468x60 Shoes
Banner 468x60 Electronics
Banner 728x90 Example.com Header
Banner 160x600 Example.com Left side
etc.

and use Drupal block visibility to determine where to show the ads. It is a pain, but it works OK. I just know it would be more efficient (and performance would be better) if Channels worked with php visibility capabilities.

I am not sure why you created the ads more than once because I just reuse the same ad, if appropriate (though the tracking code will be a bit off).

Based on your description, I am quite a bit more technical I guess but haven't gotten deep enough in this to figure out a fix :-( lol

EDIT: OK, it looks like you might be referring to the automatically created blocks within the same site ... most of mine are served from one site to others so the block flexibility is much better than way (block visibility is done in the site receiving/showing the ad). In fact, I have on occasion served the ad remotely within the same site ... but I know that is more of a server hit and I rarely do that.

I have been looking at alternatives outside of Drupal but I am really hoping that this one can be fixed because I could then make some code to allow Node Import to load up a bunch (100's or 1000's) of Ads at a time into the Ad "repository" with some logic to put them in the right groups.

The other most viable self-hosted/self-serve/opensource solutions I have researched require a Java Virtual Machine which would be real pain to have to setup on its own.

RedBob62’s picture

Hi @anonymous 7: Just a quick note to thank you for your comment regarding not needing to create ads more than once. I had not realised that an ad can be attached to more than one ad group so based on this understanding my solution now looks as follows:

a) My aim is to display only product specific ads on product specific pages while also displaying the same ads on non product specific pages. I have three areas where I display ads (header, column 1 and column 2) and 7 product areas (Life, health, pensions etc).
b) I have now created 3 ad groups for each product (e.g. header pensions, col1 pensions, col2 pensions etc) plus 3 more general ad groups for display of ads on non product specific pages, giving a total of 24 ad groups.
c) I have modified the URLs for the product specific pages to feature a unique code for each product (e.g. adding ‘/adgp06/’ to a health product page's URL).
d) I have then used the normal block display controls to only display those blocks on the product specific pages which feature the right product code in the URL.
e) I have also configured the 'general' ad group blocks to appear on all pages other than those which feature the product specific code in the URL.
f) Finally I have attached all my ads to the appropriate one product specific ad group and to the general ad group based on where I want them to appear on the page.

This process is a little cumbersome to set up and would probably not be appropriate if you have lots of product types or places on the page where you want ads to appear. However if these are not a requirement it does provide an effective work around for the problem with channels so I hope it is of use to someone.

Cheers

Bob

anonymous07’s picture

@RedBob62: I think we are effectively doing the same thing, but if I understand this correctly, you are probably playing with URLs etc because you are using the standard Drupal visibility options, i.e.,

Show on every page except the listed pages.
Show on only the listed pages. 

I am using PHP for the ad block visibility:

Show if the following PHP code returns TRUE (PHP-mode, experts only).

This is giving me a lot more flexibility, like

show this ad block to "special users" only (identified by a group and other characteristics)
show this ad on the 2nd (and higher pages) of a multipage view only, etc 
show this ad only on the 1st page of the multipage "frontpage" view (note that "<front>" cannot accomplish this)
show this ad to someone who searched for "shoes" on a custom "Search" page or embedded catalog page, etc

Having said that though, IMHO it still does not match the ease with which Channels (with the proper functioning PHP visibilty) would work

anonymous07’s picture

I found a fix for the ads not display since testing & deleting Channels problem ... I forgot all about

  • this fix: for this issue: #597116: ad module not displaying ad
  • (and this fix for this issue: #547644: Remote Ad Code Not Working which started to occur again after I upgraded to the latest Dev version)
  • I forgot that they have not been committed yet so I had to reapply the patches. That solved it for me.

    RedBob62’s picture

    @anonymous 7: You are the right, the approach I am taking is partly because I do not need a more sophisticated solution and partly because up until a few days ago I though PHP was a PHD for dyslexics!!!. I do agree however with your comments that if the channels operated as they should we would not need the work around.

    Anyway, pleased to see that you have solved you non display issue.

    lrwebks’s picture

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

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