Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The module 'SimpleAds' is kinda new and I can't find any documentation about it. The module looks pretty straight forward but for some strange, maybe stupid, reason I can't get the ad statistics to work.
I created a text ad and an image ad, as Admin I can see the tab 'ad statistics' but when I refresh or click on it as an anonymous user or as admin no counters go up.
I checked the permissions: "Count ad impressions" and "Count ad clicks" are checked for all roles.
Doesn't somebody have more documentation or an answer for this case?
Kind regards
Comments
Comment #1
minnur CreditAttribution: minnur commentedHi, Please try to remove the module from the site, clear the cache, run cron. And then try to install it again and see if you still can reproduce the issue.
Thank you.
Comment #2
minnur CreditAttribution: minnur commentedComment #3
brahimmouhamou CreditAttribution: brahimmouhamou commentedShould you see the counters go up immediately?
Just removed it, cleared the caches, ran the cron, reinstalled it, created a simpe ad node.
Visited the ad as admin but also as anonymous.
Result: nothing, all counters stay on 0/0
Do I need to wait at least an hour before the first results are shown?
Comment #4
minnur CreditAttribution: minnur commentedNo, you don't need to wait, it should increase all counters immediately.
- Do you see any error messages in logs ?
Comment #5
minnur CreditAttribution: minnur commentedI need more information from you in order to try replicate the problem.
Comment #6
brahimmouhamou CreditAttribution: brahimmouhamou commentedNo, no errors in the logs.
I did put the ads in a views that is displayed in the sidebar.
I also can tell you that at the moment I'm using Drupal 7.8.
Is there other information that you like to have?
Comment #7
brahimmouhamou CreditAttribution: brahimmouhamou commentedOh btw, I also tried the following: uninstalling the current simpleads module and installing the dev-version, same result: no incrementation.
Comment #8
brahimmouhamou CreditAttribution: brahimmouhamou commentedOk so because I didn't get response for a while I tried SimpleAds on a brand new drupal 7.12 installation and without success,
counters aren't going up, am I the only one having this problem?!
But I did get this message:
Comment #9
minnur CreditAttribution: minnur commentedPlease check impressions/counts table in the database and confirm that the table has records.
Also please read this:
Comment #10
brahimmouhamou CreditAttribution: brahimmouhamou commentedI'm not behind a reverse proxy so that won't be the issue.
But to respond to your first remark, I don't see anything in the tables:
Only the simpleads_blocks table has records.
Comment #11
minnur CreditAttribution: minnur commentedEnable "Count impressions" and "Count clicks" for anonymous users. Then open different browser and keep clicking ads and refreshing the page. MAKE SURE that you are not logged in.
Comment #12
brahimmouhamou CreditAttribution: brahimmouhamou commentedThat's what I did the first time, and I just now repeated the process.
I also created a link into a text ad so that I can click on that link and on the ad title.
I'm logged in as admin in Chrome and am an anonymous user on Safari.
Still nothing changes, the tables are still empty.
Comment #13
minnur CreditAttribution: minnur commentedCan you show me redirection URLs ?
Comment #14
profak CreditAttribution: profak commentedStatistics works good in 1.7!
Comment #15
brahimmouhamou CreditAttribution: brahimmouhamou commentedWhere can I look up these redirection urls?
I normally click on the title of the ad, so it redirects to a /node/[nr].
Comment #16
profak CreditAttribution: profak commentedrimbah, try to log out and you will see magic.
I think this behaviour just perfect. Admin always gets to advertisment node, where he can change settings, while simple users being redirected to redirection url.
Comment #17
brahimmouhamou CreditAttribution: brahimmouhamou commentedSo I tried this when logged off but I still get the url: /node/[nr]
Then when I click it, I get redirected to the simplead node, it says the following:
Comment #18
minnur CreditAttribution: minnur commentedMake sure that your ad url has http(s): in it. e.g http://google.com and not "google.com".
Comment #19
brahimmouhamou CreditAttribution: brahimmouhamou commentedOk first of all I only get the option for a redirection link if it's a image or flash ad.
So I tried the image ad, filled in the redirection url with 'http://www.google.com'.
Saved but when I hover the image in an other browser (not logged in) I just see the link /node/[nr].
No redirection done to my filled in link (google). Still links to the node and gives an Access Denied.
Comment #20
minnur CreditAttribution: minnur commentedThis is weird, at least it should show something like simpleads/redirect/[node_id] or simpleads/redirec/www.google.com in case if your link missing "http(s)://" (in 7.17 version, this is fixed in dev version).
Comment #21
minnur CreditAttribution: minnur commentedComment #22
brahimmouhamou CreditAttribution: brahimmouhamou commentedYez, I think that might be the problem from the start, in all my tests I never saw that redirection from simpleads, just /node/[nr]...
Just created another new install of drupal and installed SimpleAds... still I see /node/[nr] instead of the redirection to http://www.google.com.
I tested this in Chrome, Safari, IE and Firefox so it's not a browser issue.. :s
Comment #23
minnur CreditAttribution: minnur commentedWhat's the default language of your site ?
Comment #24
minnur CreditAttribution: minnur commentedand what does [nr] mean ?
Comment #25
brahimmouhamou CreditAttribution: brahimmouhamou commentedLanguage is English.
I used [nr] for 'the node id', ex. /node/23
should have used '/node/[nid]'
Comment #26
brahimmouhamou CreditAttribution: brahimmouhamou commentedIs there anything other I can check/do/test?
Comment #27
minnur CreditAttribution: minnur commentedCould you write all the steps that you are doing to install SimpleAds ?
Comment #28
brahimmouhamou CreditAttribution: brahimmouhamou commentedComment #29
minnur CreditAttribution: minnur commentedhm, I have no idea why this happening to you.
Could you also try directly access redirection URL: http://yourisetname/simpleads/redirect/[ad_node_id] (as anonymous user).
Comment #30
brahimmouhamou CreditAttribution: brahimmouhamou commentedHello again,
So I did what you asked me to and I got the following results.
1. Created a text ad and went to your url:
2. Created an image ad an went to your url which redirected me to google:
So that seems to work, which means that the only thing we need to know is why we aren't getting the url-redirects when I create an ad?
Comment #31
minnur CreditAttribution: minnur commentedMaybe you have older theme templates that overrides newer ones?
Comment #32
brahimmouhamou CreditAttribution: brahimmouhamou commentedCan't be as i use the original drupal theme and already checked the module with a new clean install.
Comment #33
minnur CreditAttribution: minnur commentedAny update on this issue?
Comment #34
brahimmouhamou CreditAttribution: brahimmouhamou commentedNope, was busy creating another website, just installed simpleAds there but still when I hover the image, it gives me yoursite.com/node/[ad_node_id]
Changed the themes: Batrik, Garland and Stark, they all give the same url, don't see any redirection.
Comment #35
minnur CreditAttribution: minnur commentedI am sorry that I wasn't able to help you with this. Currently I am extremely busy on some big projects and most likely I can take a look at this next month.
Please keep me posted.
Thanks,
Minnur
Comment #36
brahimmouhamou CreditAttribution: brahimmouhamou commentedI think I know the problem. When you create a node, it gets displayed on the frontpage automatically.
I was always testing the ad on this published frontpage or in a views-block made by myself. Is it possible that it's normal that in those cases the redirect will not work?
Incredibly stupid but it was the first time now I tested the ad by using the block already predefined in the blocks section:
- block: content ads
- block: sidebar ads
And when I use one of those it works perfectly!!
Comment #37
minnur CreditAttribution: minnur commentedThanks for the update. I am closing this issue.
Comment #38
dgtlmoon CreditAttribution: dgtlmoon commentedSeems to be active again in the 7.x-2.x-dev snapshot, atleast from today.
I have uploaded an image and given it a destination URL, ie http://google.com/
but the link on the image goes directly to http://google.com, no stats or redirects are present, The stats page for the node just has the headers for the stats table and no data/rows
Comment #39
dgtlmoon CreditAttribution: dgtlmoon commentedEhhh i'm starting to think this is a different issue, it could be the lack of documentation that's causing the issue
I'm seeing some stats in the table, but the is going directly without any redirect, so i guess there must be some other hook going on?
however stats arent showing on that page just yet, really confusing :/ sorry
Comment #40
dgtlmoon CreditAttribution: dgtlmoon commentedComment #41
dgtlmoon CreditAttribution: dgtlmoon commentedAds show up after some time, tho not after running the cron job directly (using ultimatecron) must be some other rule that triggers them
Comment #42
duntuk CreditAttribution: duntuk commentedIt's only running on cron if the date is different (not including time). Meaning, every 24 hours it collects statistics.
Comment #43
minnur CreditAttribution: minnur commenteddgtlmoon, thanks for clarification.
Comment #44
bjlewis2 CreditAttribution: bjlewis2 commentedIs it possible to get statistics sooner than the next day? ie: hourly like the 1.8 version does?
Comment #45
chrisdkemper CreditAttribution: chrisdkemper commentedSo I've been looking at this, because I'm reviewing the module for a client.
I've looked through the code, and as duntuk mentioned, it's only updating the stats once a day. This is a huge problem, because if you run cron frequently (as this client does) The first run will then lock out anymore stats updates for the whole day, so a lot of the ads will never disable. I've looked in the code, and the only insert reference to the `simpleads_stats` is in the cron hook.
In my case, my impressions and clicks are recording, but because the simpleads_stats only gets updated on cron, and all of the checks to display the stats or hide the ads depend on this table, it's a huge problem. There needs to be a hook on every impression/click that's recorded that does the job of the following in the cron hook.
I haven't looked at the 1.8 version, but it seemed to have actively updated stats (when it worked) and also showed the hourly stats. Now the module only works in 24hr intervals, which for sites that have a lot of traffic and rely on the click/impression limits, this won't work.
For my review purposes, this module is the only one that really fits the need, but to use it, I'd need to fix it, and I'm not sure the client will pay me to do that, sadly.
Comment #46
FranCarstens CreditAttribution: FranCarstens commentedI attempted to access the redirect url directly using the format http://mysite/simplads/redirect/[nid] but this failed. After taking a look in simpleads.module I noticed the following:
I adjust my view URL rewrite to read
a href="/node/[nid]/stats/redirect"
and that worked.I'll see tomorrow (on daily cron?) if those clicks were actually tracked though.
Comment #47
FranCarstens CreditAttribution: FranCarstens commented@chrisdkemper, I'm not a developer but a quick look in the module makes me wonder, wouldn't changing the following lines (in cron.inc) change when stats are aggregated?
Comment #48
ahmed.raza CreditAttribution: ahmed.raza commentedHi, i am having the same problem. Everything was working fine on live site, then suddenly the module stopped tracking the stats of ads. Im using version 7x.1.8
Comment #49
esolano CreditAttribution: esolano as a volunteer and at Achieve Internet commentedHi all,
We're currently using Simpleads 7.x-2.x-dev on a client's site. He is reporting the print stats are not matching what google analytics shows (total prints on a page where my ad shows up). After looking into some reported issues, and analyzing the code for a while, we got to the conclusion that the current way stats are being aggregated might be causing the issue, specially if cron is run once a day. Here's why:
If cron runs once a day, it retrieves all prints from a day ago, but only that day, leaving out all today’s prints. So say we run cron today at 10pm (today is 2018-04-11). The
FROM_UNIXTIME(timestamp, '%Y-%m-%d') BETWEEN CURDATE() - INTERVAL 1 DAY AND CURDATE() - INTERVAL 1 SECOND
where clause would be between 2018-04-10 and 2018-04-10 23:59:59; but leaving out all today’s prints since 2018-04-11 00:00:01. Then it will aggregate yesterday's data, and wipe out all prints for any ads aggregated. This cycle repeats every day.As you can see, there will be data lost (not aggregated) every day. The next day it will aggregate all data from 2018-04-11 to 2018-04-11 23:59:59, but without the prints that were deleted.
We worked on a patch that we're still testing, based on https://www.drupal.org/project/simpleads/issues/2449663#comment-11124609, but adjusted to work in version 7.x-2.x. It seems to be working for us.
I hope this helps solve this issue.
Regards.
Comment #51
esolano CreditAttribution: esolano as a volunteer and at Achieve Internet commentedFixing small issue in #49 patch from automated test.
Comment #52
esolano CreditAttribution: esolano as a volunteer and at Achieve Internet commentedAnother small change.
Comment #53
minnur CreditAttribution: minnur as a volunteer commented