I have two Drupal instances set up on my hosting account. One is the development/testing server, and the other is the production server. I built the site on the dev server and then copied files and migrated the database to the production server.

The site layout is like this (I'm not proud of this, it just turned out this way):

[public_html] weavezinedev.com (dev server)
[weavezine] weavezine.com (production server)

So the testing server is at the root, and the production server is in a subdirectory of the root. They are two completely separate Drupal installations, with separate files, databases, and domains.

What's happening is this: when a user clicks on an ad on the weavezine.com site, it pulls up http://www.weavezinedev.com/ad/redirect/%/t% (where % is the ad nid)

So impressions are being counted on the production server, but clicks are being counted on the test server. (Which was actually a relief, because for a while I thought no one was clicking on my ads.)

I've been through the admin pages for the ad module, and can't find a place to specify the redirect page. I found the following comment "Using detected adserve scripts: modules/ad/serve.php, modules/ad/adserve.inc" Could this be part of the problem? Is the module -detecting the ad module installed at the root?

So my questions are:
--------------------
1) How do I get the ads on the production server to call the redirect page on the production server instead of the test server?

2) How do I port the click statistics (and only the click statistics) from the test server to the production server?

I've got advertisers excited to check out their live ad stats, but I don't want them to see 3000 impressions, 0 clicks, cause that's not a compelling story for them to come back and buy an ad next month.

Help?

CommentFileSizeAuthor
#3 ads.redirect.gif47.27 KBWeaveGeek

Comments

WeaveGeek’s picture

Okay, I found my way to the documentation directory. Pretty nice!

In adserve.inc, I think I've found the answer to my problem, if only I could figure out the correct path to set. Would the following line fix this bug if I can figure out the right form for the path? Also, any tips in that regard? What I've tried thus far isn't working...

define('DRUPAL_ROOT', '/public_html/weavezine');

WeaveGeek’s picture

Well drat. I found the right path to specify for hard-coding my DRUPAL_ROOT for the weavezine subdirectory, but my production site is still pulling up the test-server's redirect page.

I went into sites/default/settings.php and set $base_url = 'http://www.weavezine.com'; but that didn't help either. I also cleared the cache, JIC that was the issue.

I've did a debug dump and here are the relevant lines:

stdClass Object
(
...
[redirect] => http://weavezinedev.com/ad/redirect/326
...
)

Invoking adserve hook 'adserve_exit_text'.
document.write('\x3cdiv class=\"image-advertisement\" id=\"ad-326\"\x3e\x3ca

href=\"http://weavezinedev.com/ad/redirect/326/t243\" onclick=\"window.open(this.href); return

false;\"\x3e\x3cimg src=\"http://www.weavezine.com/sites/default/files/joy_sitead2_rotating.gif\" alt=\"Just

Our Yarn\" title=\"Just Our Yarn\" width=\"140\" height=\"200\" /\x3e\x3c/a\x3e\x3c/div\x3e');

WeaveGeek’s picture

StatusFileSize
new47.27 KB

Okey-doke. I think I've got this one sorted. The issue is that the redirect URL is being hard-coded in the database in the [ads.redirect] field.

So, when I used the backup and migrate module to migrate my module from the dev to the production server, the hard-coded URLs for the test server were also migrated over.

I would recommend that the [ads.redirect] field store only the path, and not the domain portion, of the URL, so that migrations to a new domain do not break.

And by break, I mean the scenario I saw at the beginning of this thread, where clicks on the production server (domain B) are being counted on the dev server (domain A)

Screen shot attached.

WeaveGeek’s picture

So. Ran into a problem trying to port over the missing ad_click statistics from the dev server to the production server. I did the table export/import and all looked well EXCEPT that the ported over clicks aren't showing up when I view ad statistics. Instead of the 814 clicks that should be there, I only see the 24 I did on the dev server during testing.

What gives? Is there some other table (perhaps ad_hosts) that I need to tweak to get the stats to show up in the ad reports?

I'd really like to get this sorted so that my advertisers could start admiring their stats on your whifty report pages. :>

I love the Ad module and can't wait to get this all straightened out.

Thanks!

WeaveGeek’s picture

Fixed my stats.

I'm leaving this in as a "you can improve migration by not hard-coding the domain in the database."

Thx

jeremy’s picture

Status: Active » Closed (duplicate)