Jump to content

Need help with counting visits on craigslist ad


dbrimlow

Recommended Posts

I appreciate any help with figuring out how to do this. I know it can be done because our competitors do it. I just don't see where to start. I'll try to give as much initial information as I can.

 

There are three different servers involved:

 

1. local office intranet

2. Craigslist

3. Our online web server

 

I need to track the number of visits to each of our real estate agents' active Craigslist listing ads, from within their control panel of the custom CMS application we created - see screenshot below - highlighted in yellow is new column that I want to ad.

 

The ads are submitted to craigslist via rss feed directly from a dedicated local intranet server - that handles nothing but our Craiglist ads management/submission program.

 

The ads don't allow any scripts or server side code to be included in the feed; they are sent via xml with only the most basic html tags. However, they do allow graphics/photos/data to be embedded from external sources (like our website host server). And I populate the listing data directly from our online listing database.

 

What I want to know is how would I actually track each visit to the ad thats on the Craigslist server itself (visit doesn't have to be unique - page refresh would count as a hit)?

 

I assume an embedded graphic of some kind in the ad that is named uniquely and dynamically  - maybe same as the ad's postingID# - when uploaded to CL.

 

But how and where do I track the visits? in our local server? from our web server? I have to write to our database in order to generate the "visits" tracking column in the agent's management screen?

 

visits.jpg

 

Thanks for anyone who attempts to tackle this.

 

Dave

Link to comment
Share on other sites

In your CL add, you will want to include an image like so:

<img src="http://www.yourserver.com/tracker.php?id=######" />

where ###### is some unique id you have in your database

 

On your webserver, you will need a PHP script at the above url that will add the visit info to your DB. It will look something like this:

<?php
  require_once('connect.php'); //DB Connect Info
  $id = (int);
  $sql = sprintf("INSERT INTO visits (id,ip_address,visit_dttm) VALUES (%d,'%s','%s')",
    $_GET['id'],
    $_SERVER['REMOTE_ADDR'],
    date('Y-m-d')
  );
  mysql_query($sql);
  header('Location: blank.gif');
  exit;
?>

where blank.gif is just a 1x1 pixel transparent gif

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.