Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How would I get the clicks / impressions from this url?
Old 09-25-2011, 06:54 PM How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Hi,

Given the following php url:

PHP Code:
$f fopen('http://example.com/scripts/amp/show.php?z=1&incl=1&ip='.getenv('REMOTE_ADDR').'&url='.urlencode(getenv('HTTP_HOST').getenv('REQUEST_URI')),'r');
echo 
stripslashes(fread($f,100000));
fclose($f); 
How do I find where the tracking information is located in the mySQL db? Where should I look in the db? I have looked but was unable to find it. The code above was generated in the ad manager script that I use to manage ads on my site.

How that code works:

I put that bit of code into my php page, and all ads from that particular "zone" will be displayed.

My objective:

I want to create my own Php/MySQL query that will pull the images from the ads table from the ads db, and link them to the website stored in the db, but I would like to link the ad images (stored in the db) to it's associating url (also store in mySQL db), BUT with the clicks / impressions data that I was unable to find in the db, only available in that php code I posted above which was generated by the ad manager script.

Hope you understand.
Thanks again!

-Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-26-2011, 01:27 PM Re: How would I get the clicks / impressions from this url?
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Look at the webserver logs.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 09-26-2011, 02:33 PM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by PaulW View Post
Look at the webserver logs.
Never really thought about that, but explain how I would be able to find that data through the logs.
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 09-26-2011, 06:12 PM Re: How would I get the clicks / impressions from this url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
How do I find where the tracking information is located in the mySQL db?
No idea.

We'll probably need to see the code that collects the data NOT the code that displays the link.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 09-26-2011, 09:47 PM Re: How would I get the clicks / impressions from this url?
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Configure the webserver's logging, use a program like awstats or Analog to analyse them. Logging can include GET strings so you can easily get counts. The only thing this wouldn't tell you is how many invalid GET strings are coming in - you could record that in code easily enough - IF zero results form query THEN write to error file

The alternative is to actually create a table that records details of each click. You could have a second table for invalid combinations in GET. (A second table as the first table would have FK relationships to exisiting tables.)

The desirability of the latter might depend on what sort of traffic you're getting or, rather, anticipating. Probably wouldn't be an issue.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 09-28-2011, 10:32 PM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I didn't want to start a new thread for this so... Here goes nothing:

Quote:
We'll probably need to see the code that collects the data NOT the code that displays the link.
I will presume that will be this file: click.php (see this url: http://reunitemysite.com/z1.php) I am guessing that the file in the url when you hover over one of the images is the one you want, so I will attach that.

Since my php skills are not quite yet up to par YET, I am wondering if one of you top notch coders can help me out with this complete utter mess of coding...Sorry Ad Manager Pro, but I seen enough of this horrible coding...

Note: I just checked my email, and received an email from the support site for the ad manager pro script, and the support rep told me this (regarding the clicks/impressions)

Quote:
Hi Brian,

You can't create the link URL. It creates an unique URL for each link to avoid publishers to cheat.
If you will not use publishers, I can modify it, so each ad will have a static link URL.

Regards
Richard
Are there other coders here that think they could manipulate this script so that there *could* be a static url, and the original url so that nothing will get compromised?

Note: Now today (9/29), I received another email from the support site, and he told me he could do a link for just the clicks, but not for impressions, I am going to see what goes from here. Still waiting on someone from this forum too though. So if you have any suggestions, please post.

Thank you in advance!
Brian
Attached Files
File Type: zip click.zip (1.6 KB, 4 views)
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 09-29-2011 at 02:31 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-09-2012, 06:17 PM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
After checking my Raw Server Log, this is what I found regarding the clicks / impressions urls:

Code:
98.109.43.195 - - [09/Jan/2012:17:36:37 -0600] "GET /scripts/amp/click.php?a=5&x=TVRNeU5qRTFNakV3TWkweE56UXVNVEl5TGpFME9TNHhNekE9&z=1&c=1&adurl=557 HTTP/1.1" 302 - "http://reunitemysite.com/richard/sample_page.php" "Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
98.109.43.195 - - [09/Jan/2012:17:36:40 -0600] "GET /scripts/amp/click.php?a=10&x=TVRNeU5qRTFNakV3TWkweE56UXVNVEl5TGpFME9TNHhNekE9&z=1&c=1&adurl=558 HTTP/1.1" 302 - "http://reunitemysite.com/richard/sample_page.php" "Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
174.122.149.130 - - [09/Jan/2012:17:36:41 -0600] "GET /scripts/amp/show.php?z=1&shape=1&incl=1&ip=92.242.136.135&url=reunitemysite.com%2Frichard%2Fsample_page.php HTTP/1.0" 200 2953 "-" "-"
92.242.136.135 - - [09/Jan/2012:17:36:41 -0600] "GET /richard/sample_page.php HTTP/1.0" 200 4952 "-" "-"
98.109.43.195 - - [09/Jan/2012:17:36:46 -0600] "GET /scripts/amp/click.php?a=9&x=TVRNeU5qRTFNakV3TWkweE56UXVNVEl5TGpFME9TNHhNekE9&z=1&c=1&adurl=559 HTTP/1.1" 302 - "http://reunitemysite.com/richard/sample_page.php" "Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
98.109.43.195 - - [09/Jan/2012:17:36:49 -0600] "GET /scripts/amp/click.php?a=3&x=TVRNeU5qRTFNakV3TWkweE56UXVNVEl5TGpFME9TNHhNekE9&z=1&c=1&adurl=560 HTTP/1.1" 302 - "http://reunitemysite.com/richard/sample_page.php" "Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
98.109.43.195 - - [09/Jan/2012:17:36:49 -0600] "GET / HTTP/1.1" 200 672 "http://reunitemysite.com/richard/sample_page.php" "Mozilla/5.0 (Ubuntu; X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1"
To summarize what I originally wanted to do was be able to track the impressions / clicks from the database instead of that fopen url shown in my very first post. Something like:

Code:
<a href=\"$row['url']"> <img src=\"banner\">
instead of the fopen url which does not allow me to work easily with other php code.

Here's the SQL file that I forgot to post originally: I had to upload to another host because it was over 1 meg. 1.10 to be exact.

http://www.filedropper.com/ducksterampsql

Thanks again!
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 01-09-2012 at 08:55 PM.. Reason: Forgot to add the SQL file for the ad manager database
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-09-2012, 10:15 PM Updated this post...
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I have re opened the following post:

http://tycoontalk.freelancer.com/php...pressions.html

I posted some log info plus the sql file for that db. I hope that's enough to solve that issue.

Thank you
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-10-2012, 10:24 AM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
~ Bump ~
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-10-2012, 10:48 AM Re: How would I get the clicks / impressions from this url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Two choices:

1. Redirect the link through a "jump" page and track it there.

2. Use the onclick event of the link to trigger an AJAX script that passes data to a server script which writes to a database.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-10-2012, 11:36 AM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Two choices:

1. Redirect the link through a "jump" page and track it there.

2. Use the onclick event of the link to trigger an AJAX script that passes data to a server script which writes to a database.
...over my head and I'm under water, could you lamen-ize that for me chris?
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-10-2012, 12:35 PM Re: How would I get the clicks / impressions from this url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.candsdesign.co.uk/article...filiate-links/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-10-2012, 10:12 PM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Hi Chris,

I got called into work earlier, so I am just now able to check out that page you suggested.

Basically all that is telling me is to redirect the url. I don't understand how that will work. Can you explain? I read the whole page, and all it's telling me is about how it's bad for search engines etc, also using the htaccess file to do the redirect..

I seen some sample code on that page, but I don't understand that code other than it redirecting to a 302 page. Could you show me some code based on the urls from my log that I have posted above?

I guess I am having a hard time understanding where I would redirect to.

All help will be greatly appreciated!

Thanks again!
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-11-2012, 07:25 AM Re: How would I get the clicks / impressions from this url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You go to the "jump" page, which records the event in a database then redirects on to the final destination URI. It works just like a "url shortener" does

The intermediate page records the referral page if present, the id or tracking code passed in the querystring in your database or increments a counter if the id already exists.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-11-2012, 09:02 AM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Quote:
You go to the "jump" page, which records the event in a database then redirects on to the final destination URI. It works just like a "url shortener" does

The intermediate page records the referral page if present, the id or tracking code passed in the querystring in your database or increments a counter if the id already exists.
!HELP ! LOST MAN @ SEA WITHOUT A LIFE JACKET...

Can someone throw me a "life jacket"

Thank you
Brian
__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 01-11-2012 at 09:05 AM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-11-2012, 10:57 AM Re: How would I get the clicks / impressions from this url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Rightio then.

Brian, do you want the "Redirects for Dummies" version or code clues so you can write it your self.
It's not the most difficult project in the world by all means, dependant upon your PHP coding skills of course.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-11-2012, 11:12 AM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
I'll try the redirects for dummies version if you please.

Tyvm chris
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-12-2012, 03:21 PM Re: How would I get the clicks / impressions from this url?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Rather than reinvent the wheel, here's a URL shortener c/w click tracking.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-12-2012, 09:28 PM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
Hi Chris,

I hate to quote my own post, but as I said, I'll take the re direct for dummies version...I really don't know what I need to do with that code on the last url you posted, assuming that php code is where I would begin??
__________________
Made2Own

Please login or register to view this content. Registration is FREE
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 01-12-2012, 09:43 PM Re: How would I get the clicks / impressions from this url?
Brian07002's Avatar
Defies a Status

Posts: 2,162
Name: ...
Location: ...
Trades: 0
If someone has the mental power to accomplish this task, please strut your mental stuff. I encourage all power thinkers. Btw, I am not totally brain dead, just more than 50% when I have a clear head, I will try to update that 50% to the actual number.

Put the code here:

Code:

__________________
Made2Own

Please login or register to view this content. Registration is FREE

Last edited by Brian07002; 01-12-2012 at 10:01 PM..
Brian07002 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How would I get the clicks / impressions from this url?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.81549 seconds with 13 queries