Title: [Plugin: Simple Ads Manager] Doesnt count clicks
Last modified: August 20, 2016

---

# [Plugin: Simple Ads Manager] Doesnt count clicks

 *  [Tagcloud](https://wordpress.org/support/users/rondena/)
 * (@rondena)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/)
 * Hi
 * Thanks for a super adsprogram. Just one step from donate 🙂
    It doesnt count 
   clicks??
 * What do I do wrong?
 * have filled the box in the ad.
 * / Andreas
 * WordPress Version: 3.2.1
    SAM Version: 1.4.44 SAM DB Version: 2.0 PHP Version:
   5.2.17 MySQL Version: 5.1.41-3ubuntu12.10-log Memory Limit: 64M
 * [http://wordpress.org/extend/plugins/simple-ads-manager/](http://wordpress.org/extend/plugins/simple-ads-manager/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Thread Starter [Tagcloud](https://wordpress.org/support/users/rondena/)
 * (@rondena)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630172)
 * Please someone help me. Have started places for ads all over the site. Dont wanna
   change plugin…..
 * Anyone?
 *  [kenlstark](https://wordpress.org/support/users/kenlstark/)
 * (@kenlstark)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630194)
 * I’m having this same issue, not counting clicks. Thought it might be cause I 
   was logged in so it just wasn’t counting my clicks. Logged out, still didn’t 
   count.
 * Still not sure if something’s wrong, or if the plugin is being smarter than me
   and excluding my clicks on purpose (which would be cool, though problematic for
   testing purposes).
 * WordPress 3.3.1
    PHP Version: 5.2.17 MySQL Version: 5.1.56
 *  Thread Starter [Tagcloud](https://wordpress.org/support/users/rondena/)
 * (@rondena)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630199)
 * Well my site have 40 000 hits per month and it seems strange if no one is clicking?
   Have tested everything i can figure but no clicks are counted.
 * Seems strange though the click counting is the most vital thing in an ads plugin,
   otherwise i could just paste pictures around the site.
 * Cant find anything on the net??
 * Anyone have the sulotion to this?
 *  [rileyem](https://wordpress.org/support/users/rileyem/)
 * (@rileyem)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630240)
 * I’m having the same problem.
 * Anyone have a solution, or at least a work-around? I’m considering adding code
   to track outbound links via google analytics, but I’d prefer the plugin work 
   as it’s supposed to. (great plugin btw, other than this click tracking problem!)
 *  [owcv](https://wordpress.org/support/users/owcv/)
 * (@owcv)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630291)
 * I have the same issue. but it’s strange… sam seems to count EVERY impression 
   on my page. If I reload the page for example 6 times, it counts 6 impressions.
   But if I click on a banner (no matter if i’m logged in or out) it counts nothing.
   So I think it would be better if there was some kind of filter (ip or something
   similar) for the impressions and a fix for the not working counts of the clicks.
   Because right now the figures given in clicks/impressions are not very helpful.
 *  [muchacho79](https://wordpress.org/support/users/muchacho79/)
 * (@muchacho79)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630311)
 * Same… counts impressions, but ignores the clicks. Isn’t this the whole point 
   of the plugin?
 * Can anybody please find a workaround where we can correct the code?
 *  [fanbolero](https://wordpress.org/support/users/fanbolero/)
 * (@fanbolero)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630312)
 * I did it!!!
    The problem was that SAM was giving a different ID syntax to the
   SWF file. I simply changed the syntax for the $id variable to reflect the one
   used by images. To count clicks for SWFs, edit line 70 in ad.class.php from:
 *     ```
       $id = "ad-".$ad['id'].'-'.rand(1111, 9999);
       ```
   
 * to:
 *     ```
       $id = "a".rand(10, 99)."_".$ad['id'];
       ```
   
 * Another Goodie:
    If you want SAM to display a substitute image in case the browser
   doesn’t have flash, change line 78:
 *     ```
       $text = __('Flash ad').' ID:'.$ad['id'];
       ```
   
 * for:
 *     ```
       $filename = substr($file,0,strlen($file)-4).".jpg";
       $linkname = substr($flashvars,11,strlen($flashvars)-13);
       $text = "href='".$linkname."'><img src='".$filename."' width='".$width."' height='".$height."' / ></a>";
       ```
   
 * and line 93:
 *     ```
       <div id='$id'>$text</div>
       ```
   
 * to:
 *     ```
       <a id='$id' class='sam_ad' $text
       ```
   
 * Note: for this to work you have to add a substitute jpg image with the same name
   and path as your swf file.
    When creating the SWF you have to define clickTag
   in “flashvars” with the destination path, like so:
 *     ```
       {clickTag:"http://www.yoursite.com/destination.html"}
       ```
   
 *  [PhysWeekly](https://wordpress.org/support/users/physweekly/)
 * (@physweekly)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630313)
 * I tried the edit to ad.class.php and its’s still not registering clicks. Is there
   anything I have to do to make the edit “active” besides simply uploading the 
   revised file?
 *  [fanbolero](https://wordpress.org/support/users/fanbolero/)
 * (@fanbolero)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630314)
 * For some reason the solution is not working in Chrome, it works on Firefox and
   Safari. Yet to test iE
 *  [fanbolero](https://wordpress.org/support/users/fanbolero/)
 * (@fanbolero)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630315)
 * for it to work you have to change sam-layout.js to:
 *     ```
       ( function( $ ) {
         $( function() {
           $( 'body' ).off( 'click', '.sam_ad' ).on(' click', '.sam_ad', function() {
             	var $me = $( this ),
             		adId = $me.attr( 'id' );
             $.ajax({
               type: "POST",
               url: samAjax.ajaxurl,
               data: {
                 action: "sam_click",
                 sam_ad_id: adId,
                 _ajax_nonce: samAjax._ajax_nonce
               },
               async: true
             });
           });
         });
       })( jQuery );
       ```
   

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘[Plugin: Simple Ads Manager] Doesnt count clicks’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-ads-manager_73687f.svg)
 * [Simple Ads Manager](https://wordpress.org/plugins/simple-ads-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-ads-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-ads-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-ads-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-ads-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-ads-manager/reviews/)

 * 10 replies
 * 7 participants
 * Last reply from: [fanbolero](https://wordpress.org/support/users/fanbolero/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-simple-ads-manager-doesnt-count-clicks/#post-2630315)
 * Status: not resolved