Support

Home Forums Event Espresso Premium eventAttendanceMode Tags for Schema

eventAttendanceMode Tags for Schema

Posted: March 23, 2020 at 6:04 pm


trainadesign

March 23, 2020 at 6:04 pm

Hi there,

I’m getting notifications from Google Search Console to include an “eventAttendanceMode” tag? How would I go about implementing that?

Thanks!


Josh

  • Support Staff

March 23, 2020 at 6:50 pm

Hi,

This is something we can add in a future version. May I ask which of the following “attendance modes” apply to your events? The three options are:
offline
online
mixed


trainadesign

March 23, 2020 at 7:17 pm

sounds good, most of our events are going to be in person or in this case offline


NHM

March 23, 2020 at 9:10 pm

But having the option of “mixed” would also be good, since some events may include the ability to remote in while others attend in person.


Josh

  • Support Staff

March 24, 2020 at 10:50 am

We’re planning on adding this to the next release of EE4.

In the case of a “mixed” eventAttendanceMode, how that will work is if the venue has a street address and the venue also has a URL set for “URL of Event:” then the eventAttendanceMode property will show “mixed”.


NHM

March 24, 2020 at 3:08 pm

Not sure how it would work but nowadays it’s not uncommon for events to be mixed like that. For instance, concerts that are also streamed. I would imagine it would work by making the template tag the URL for the event appropriately and differently than the street address for the event. When the search engines see an event is tagged as mixed, I’m sure they’ll apply some fancy algorithmic considerations to sort it all out.


Josh

  • Support Staff

March 24, 2020 at 3:11 pm

For events like you’ve described, we recommend setting the “URL of Event” field within the venue. If that URL is set, the appropriate tag will be output in the event schema markup.


Josh

  • Support Staff

March 30, 2020 at 2:16 pm

Update:

This has been added in version 4.10.5.p.


Daniel

April 3, 2020 at 1:00 pm

Hi!

I noted this was added… however, how can I control it?

All of our events are now online.

I see in the code I can set a virtual URL and get OnlineEventAttendanceMode

But, two things:

I already added to my Schema ld+json using a hook.

I don’t want to modify every venue on our hundreds of events. Eventually, we will have normal life again and it will just have to be switched back.

How can I turn off this extra schema being added? It conflicts with my already hooked-in schema modifications I’ve made in functions.php.

Thanks!


Daniel

April 3, 2020 at 1:48 pm

I have now hacked the json schema template to remove the new schema lines.

I know this is not sustainable, but I need the correct info put into my schema and this solution is not viable.

Here’s what I need and what I achieved using the existing hook:

`
“eventAttendanceMode”: “https://schema.org/OnlineEventAttendanceMode”,
“eventStatus”: [
“https://schema.org/EventMovedOnline”
]
`

Please inform how this will be updated for situations where we don’t want to modify Venue information to control the schema.org tags.

Thank you!


Josh

  • Support Staff

April 3, 2020 at 1:53 pm

Hi Daniel,

You can use the
FHEE__EEH_Schema__add_json_linked_data_for_event__template_args
filter hook to pass in custom values for the $template_args array.

See also:
https://eventespresso.com/topic/ldjson-customization/#post-302211

and

https://eventespresso.com/topic/ldjson-event-description-displays-shortcodes/#post-309884


Daniel

April 3, 2020 at 2:13 pm

Ok, great! I had noticed that hook (FHEE__EEH_Schema__add_json_linked_data_for_event__template_args), but was concerned about my ability to use the array syntax using that hook – it doesn’t allow that.

However, I can use the single element syntax with no issue. Not as customizable, but in my case it doesn’t matter – I just removed the syntax to use – EventMovedOnline.

For anyone who wants to see:


function tasny_modify_schema_org($template_args,$event,$VNU_ID){
	$template_args['event_attendance_mode'] = 'OnlineEventAttendanceMode';
	$template_args['event_status'] = 'EventMovedOnline';
	return $template_args;
}
add_action('FHEE__EEH_Schema__add_json_linked_data_for_event__template_args','tasny_modify_schema_org',10,3);

Thank you!
D


Josh

  • Support Staff

April 6, 2020 at 9:30 am

Hi,

I’m not sure why you wouldn’t be allowed to use array syntax in your custom callback function, can you elaborate?


Daniel

April 6, 2020 at 9:38 am

Sure!

The callback can only manipulate the values of the array.
The templated json concatenates the https://schema.org string with the array value.

Therefore, you cannot implement an array using the hook:
FHEE__EEH_Schema__add_json_linked_data_for_event__template_args

See the json template:



  "eventAttendanceMode": "https://schema.org/<?php echo $event_attendance_mode; ?>",
  "eventStatus": "https://schema.org/<?php echo $event_status; ?>",
 


Josh

  • Support Staff

April 6, 2020 at 1:14 pm

It sounds like you want to pass multiple event statuses. We can do a pull request with some changes to the template that will make that possible.

The support post ‘eventAttendanceMode Tags for Schema’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso