Running adverts in listings

Home Forums Calendar Products Events Calendar PRO Running adverts in listings

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1088619
    jameswemyss
    Participant

    We are trying to get ads to run within listings (as per this page). However we are having problems with doing it in your plugin.

    Oddly they seem to appear on Orginiser pages

    But not on the main Events page

    We need to know how to insert ads at specified points in the ajax response, preferably where the tribe_events_inside_after_loop action is called in the templates.

    Please note this URL is a staging enviroment for the main domain funferret.co.uk
    Thank you in advance for your help.
    Regards
    James

    #1088891
    Cliff
    Member

    Hi James. Thanks for your question.

    If you’re asking about the Single Event view, look for do_action throughout https://github.com/moderntribe/the-events-calendar/blob/develop/src/views/single-event.php

    If you’re asking about the archive views (e.g. Month, List, etc), please reference this plugin.

    Let me know if you need anything else.

    #1092521
    jameswemyss
    Participant

    Hi Cliff,
    Apologise for not coming back sooner. It is an urgent problem and have been patiently waiting for a response but obviously hadn’t ticked the “Notify me of follow-up replies” box. So my fault for being so slow, sorry!

    So maybe I need to clarify a bit more…
    We need to insert ads into the standard events listing – this page: http://www.funferret.co.uk/events/ – and they need to be placed in between the listed events. At the moment the ads do load successfully, but immediately after the page loads there is an ajax reload which strips out the ads.

    Could you let us know how to fix this? It might save us a lot of time if you were able to tell us where the html for the ajax response is generated so that we can add the ads to that as well.
    Interestinglt though on Venue or Oriniser pages they do work (http://www.funferret.co.uk/venue/st-michaels-church-hall/)

    Regards
    James

    #1093022
    Cliff
    Member

    Hi. Here’s some information from one of our developers that’s hopefully helpful enough that you can get your customization in place!

    The methods that create the Ajax responses are overrides of Tribe__Events__Template_Factory::ajax_response() so in the case of Map View, it is Tribe__Events__Pro__Templates__Map::ajax_response()

    We also have a filter hook that can be used to modify the response data before it leaves the server: tribe_events_ajax_response
    (though it’s suspected that you’d want to do things earlier than that)

    Please let me know how things go. It’s a pretty neat use case. If you get a solution to share with others, feel free to post it here.

    #1093384
    jameswemyss
    Participant

    Hi Cliff,

    Thanks for that info, those were exactly the bits we were trying to find. That made it easy to add the html for the ads into the response, but unfortunately it turns out that wasn’t the main problem!

    It turns out that Google AdSense doesn’t allow ads to be reloaded via AJAX because it’d be an easy way for people to artificially increase their ad revenue. It looks like there may be ways to get around the restriction, but it’d naturally take more time for us to understand what needs to be done.

    A simpler solution to save all that time would be to turn off the AJAX reload in the tribe plugin completely. We can’t find anything in the plugin options; is this something you’ve built in to the plugin at all?

    #1093747
    Cliff
    Member

    Interesting…

    This is untested but was provided to someone else in the past for Month View. I just copied, pasted, and modified to use the List View function instead: https:// gist. github.com /cliffordp/4a22ce32a415a3ec9f54 (without spaces in the URL)

    Please let me know how things go.

    #1094381
    jameswemyss
    Participant

    I’ve added that to the functions.php, but the script isn’t showing up on the site. The function doesn’t have any obvious flaws, so I suspect the reason it’s not appearing yet is an issue with the hosting – this kind of thing happens with irritating frequency on GoDaddy. We’ll have to check it out later.

    However, I’m pretty certain that the script won’t solve the problem.

    It removes/replaces the AJAX trigger for when someone clicks the “next” or “previous” buttons, but (unless I’m mistaken) it won’t prevent the automatic AJAX reload that happens the moment the user visits the page. As a result, each time they click one of those buttons that script will cause the page to load properly (without AJAX), complete with ads, and then the ads will be removed again by AJAX. I’m also pretty sure that the script won’t prevent the AJAX reload when people update the filters.

    I guess we could write a script which listens for AJAX requests, compares the request url with the current window.location, then updates the window.location if the two don’t match, but that does seem like a pretty backwards way to handle it!

    Any other ideas that would be less awkward?

    #1094886
    Cliff
    Member

    Thanks for the additional details.

    The developer that’s been helping us with this one wasn’t sure why the map gets reloaded via Ajax the way it does. It might be something we choose to investigate further in the future but isn’t something we’d consider a bug at this time.

    As such, per our Scope of Support / Terms, I think we’ve helped about as much as we can thus far with your customizations.

    I hope you understand.

    Of course, if you discover anything more, feel free to share so our developers can analyze and possibly improve things here in the future.

    Thanks! 🙂

    #1101419
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Running adverts in listings’ is closed to new replies.