Schema On Event List Pages

Home Forums Calendar Products Events Calendar PRO Schema On Event List Pages

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1209848
    Brandon Hughes
    Participant

    Hello,

    I am trying to get my events to show in Google search similar to another site that also uses TEC, https://www.hawaii.com/events/ their events show in google search like this, http://prntscr.com/dk5tnr.

    Right now for my site the schema markup is showing only for individual events and not list of events.

    I had someone take a look and do some tests, here is their response. “And when I check the pages with Google Structured Data Testing Tool, the event markup is correct for the individual events, showing event and hentry types https://search.google.com/structured-data/testing-tool#url=http%3A%2F%2Ffullofevents.com%2Fhawaii%2Fevent%2Fchristmas-in-polynesia%2F but not for the list page https://search.google.com/structured-data/testing-tool#url=http%3A%2F%2Ffullofevents.com%2Fhawaii%2Fevents%2F

    Are you guys able to help me with this?

    Thanks

    #1211475
    Nico
    Member

    Hi there Brandon,

    Thanks for getting in touch with us! You are right our listing pages don’t have a specific output of structured data as the single events have’s.

    Quick solution you can add an ‘Events List’ widget (which haves the option to output structured data) to the pages in which you want this data to be fetched. The not so quick solution (seems the folks from hawaii.com have done this) is to customize the event list templates (as explained in our themer’s guide) to add the necessary markup for each event to be recognized as such by Google. If you inspect the code from hawaii.com you’ll notice the hentry vevent and other classes that tag the event information.

    I’ll explore a third option of outputing the ld+json structured data for list view via snippet, but not sure if it’s easily achievable. Give me a bit of time and I’ll get back to you on this.

    Best,
    Nico

    #1211481
    Nico
    Member

    Hey Brandon,

    After some testing I came with a snippet to add the structured data to list view. Just paste the code below in your theme’s (or child theme’s) functions.php file and give this a try:

    /* Tribe, add structured data to list view */
    function tribe_list_view_structured_data ( ) {

    // bail if not list view
    if ( !tribe_is_list_view() ) return;

    global $wp_query;

    Tribe__Events__JSON_LD__Event::instance()->markup( $wp_query->posts );
    }
    add_action( 'wp_head', 'tribe_list_view_structured_data');

    I haven’t heavily tested this and not sure how it will behave with Google, but I guess it’s at least a good starting point to get this working.

    Please let me know about it,
    Best,
    Nico

    #1211561
    Mathew
    Participant

    Nico,

    Thanks for the snippet. It’s one I’ve been looking for.

    On a side note: The hawaii.com website is using version 3.12 of TEC. The implementation of the structured data and the use of event markup tags has changed in version 4.x.

    Now playing the waiting game with Google to see if the snippet has the desired effect.

    Again, Thanks Nico.

    #1211712
    Nico
    Member

    Thanks for the feedback Mathew! Seems you are better informed than me 😉 It’s always a pleasure when you chime in!

    Please give us a heads-up when you have a chance to see if this works as expected. I’ve flagged this to be discussed at next team scrum… Should we add structured data (or at least the option) in all calendar pages? I see you have reached out in the past to make a point on this. If you want to add any opinions here (Brandon you are welcome to do it as well) feel free to do so!

    Thanks,
    Nico

    #1214918
    Brandon Hughes
    Participant

    Hi Nico,

    So far no joy.

    Should this work with multisite as well?

    Thanks

    #1217556
    Nico
    Member

    Thanks for the follow-up Brandon!

    Should this work with multisite as well?

    I think so. It’s actually pretty easy to check for this, just paste the snippet in the theme’s (or child theme’s) functions.php file and then visit the calendar (list view). In the source code of the page (in the head tag) you should find the following structure:

    <script type="application/ld+json">
    [{"@context":"http://schema.org","@type":"Event","name":"Your first event in the view name",...
    </script>

    Please let me know if you are able to check for this,
    Best,
    Nico

    #1219255
    aurelien
    Participant

    Hello,
    For category pages, the code is good

    /* Tribe, add structured data to list view */
    function tribe_list_view_structured_data ( ) {
     
        // bail if not list view
        if ( !tribe_is_list_view() ) return;
     
        global $wp_query;
     
        Tribe__Events__JSON_LD__Event::instance()->markup( $wp_query->posts );
    }
    add_action( 'wp_head', 'tribe_list_view_structured_data');
    

    But it does not work for places.
    Do you have the solution?

    #1219403
    Nico
    Member

    Hi there @aurelien,

    Thanks for chimming in! The snippet will only work in list view as it’s coded. That’s why it’s not working in places (I guess you mean venue pages).

    Can you please open a new thread for this? Be sure to link back to this one, and ask for help adapting the snippet for your needs.

    Thanks,
    Nico

    #1221693
    Brandon Hughes
    Participant

    Hi Nico,

    The developer I work with has tested this and still does not see any schema code being generated on the list page.

    Let me know if you have any other ideas or suggestions and we will test.

    Brandon

    #1222559
    Nico
    Member

    Thanks for the heads-up Brandon and sorry to hear about this still not working 🙁

    I’ve just tested this with default Theme Tweenty Seventeen, in a local multisite install and it’s working as expected. Can you please ask the dev to test this with default theme (temporarily adding the snippet to the functions.php file) and no other plugins active? This way we can see if there’s a conflict with the snippet.

    Other things to check:
    – Remember this version of the snippet is just intended to work in list view.
    – Reset all types of cache and make sure the source code is refreshed.

    The snippet is actually pretty simple, and I can’t think of others reasons why this is not working for you. But please let me know about the tests above and I’ll help as possible.

    Best,
    Nico

    #1234593
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Schema On Event List Pages’ is closed to new replies.