Support » Plugin: GigPress » Google events

Viewing 12 replies - 1 through 12 (of 12 total)
  • +1

    I’m now getting errors like this on my Google Search Console…

    Missing field ‘eventAttendanceMode’
    First detected: 22/03/2020
    Status: Warning

    I’ve decided to edit the PHP code myself.

    Take a backup of this file:-

    wp-content/plugins/gigpress/output/gigpress_shows.php

    and you can start adding some code like this which will temporarily fix the problem while we wait for the developer!

    Find the line that begins function gigpress_json and then add the line like mine…

    function gigpress_json_ld( $showdata ) {
            // Start array for single event
            $show_markup = array( "@context" => "http://schema.org", "@type" => "Event" );
    
            // Extra attributes for Google Events
            $show_markup['eventAttendanceMode'] = "https://schema.org/OfflineEventAttendanceMode";
    
            // Add show level attributes

    …this is a work in progress but please contact me and I will happily send you my latest code.

    🙂

    Regards,

    Paully

    Thanx, I will do this later.

    Tweaked code… I’m a PHP newbie, so it’s taking a while, but just check back every day for new code.

    I am trying to put it in to 1 block of code, because I don’t think it matters in which order the JSON-LD data comes in…

            // Extra attributes for Google Events
            $show_markup['eventAttendanceMode'] = "https://schema.org/OfflineEventAttendanceMode";
            $endDate = date_create($showdata['iso_date']);
            date_add($endDate,date_interval_create_from_date_string("3 hours"));
            $show_markup['endDate'] = date_format($endDate,"c");

    🙂

    Paully

    …and add this line just before the “* Provides an opportunity to customize ” section at the end of the json code block…

    
            // Create blank 'image' attribute for Google Events
            $show_markup['image'] = $image_markup;
    

    Also, 2 more things to do in the GigPress dashboard which will make sure you get ALL the correct JSON-LD elements…

    1) add a ‘ticket price’ to a show, which will make sure you get an ‘offers’ JSON entry.

    2) add a ‘status’ entry from the drop-down (like Active or Cancelled), which will make sure you get a ‘eventStatus’ JSON entry.

    Please let me know how you get on.

    BACK UP YOUR FILE FIRST!

    🙂

    Paully

    Slightly ironic, but there has been an official update to this plugin yesterday to version 2.3.24…

    https://wordpress.org/support/topic/%f0%9f%93%a3gigpress-2-3-24/

    …which will (ofcourse) wipe out the code changes in this forum thread.

    So, just repeat the steps… backup the file and hack the code.

    Hopefully, the new developers (Modern Tribe) will see his thread and commit to making the Google Events JSON-LD code part of the plugin!

    🙂

    Paully

    Plugin Contributor András Guseo

    (@aguseo)

    Hi @plittlefield

    Thanks for this recommendation!

    GigPress is open source and the GitHub repo is publicly accessible.
    Would you be open to suggesting your changes directly in the repo?
    https://github.com/moderntribe/gigpress

    Then our devs can take a look at it and merge it for the next release.

    Cheers,
    Andras

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    I’m one of the developers on the team that maintains this plugin and I can confirm that Andras is correct here — feel free to suggest the changes directly on our GitHub. We continue to incorporate changes suggested by the community, this would be another great addition!

    Sure, I will do that this weekend!

    Done 🙂

    Google has crawled my customer’s site again and the ‘image’ JSON-LD is incorrect, so I have added a generic photo to their WP Dashboard media library and then tweaked the PHP code to add the image…

            // Create blank 'image' attribute for Google Events
            $image_markup = 'https://www.mydomain.com/wp-content/uploads/2020/04/google_event.jpg';
            $show_markup['image'] = $image_markup;

    …which then shows up like this in the web browser source code…

    "image": "https://www.mydomain.com/wp-content/uploads/2020/04/google_event.jpg"

    …which should keep Google happy.

    Hope this helps.

    Regards,

    Paully

    Plugin Contributor András Guseo

    (@aguseo)

    Thanks a lot for your submissions @plittlefield. I’ll let the devs know about it and hopefully we’ll be able to get it into the next round.

    Cheers,
    Andras

Viewing 12 replies - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.