I have installed and configured the Official Facebook Pixel plugin. Now I would like to create a shortcode that will trigger a selected server-side event.
[myapp_fbevent event_name="test"]
How can I implement such shortcode? I have inspected the plugin source code and came up with something like this:
function myapp_fbevent_shortcode($event_name) {
do_action('send_server_event', $event_name);
}
add_shortcode('myapp_fbevent','myapp_fbevent_shortcode');
Is this a correct usage?