Simple Ads Manager
Doesnt count clicks (11 posts)

  1. Tagcloud
    Posted 4 years ago #


    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


  2. Tagcloud
    Posted 4 years ago #

    Please someone help me. Have started places for ads all over the site. Dont wanna change plugin.....


  3. kenlstark
    Posted 4 years ago #

    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

  4. Tagcloud
    Posted 4 years ago #

    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?

  5. rileyem
    Posted 4 years ago #

    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!)

  6. owcv
    Posted 4 years ago #

    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.

  7. muchacho79
    Posted 3 years ago #

    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?

  8. fanbolero
    Posted 3 years ago #

    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);


    $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'];


    $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>


    <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:

  9. PhysWeekly
    Posted 3 years ago #

    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?

  10. fanbolero
    Posted 3 years ago #

    For some reason the solution is not working in Chrome, it works on Firefox and Safari. Yet to test iE

  11. fanbolero
    Posted 3 years ago #

    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' );
            type: "POST",
            url: samAjax.ajaxurl,
            data: {
              action: "sam_click",
              sam_ad_id: adId,
              _ajax_nonce: samAjax._ajax_nonce
            async: true
    })( jQuery );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Ads Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic