А $widget_id откуда берется?
{if $widget_id = $modx->getOption('jivosite.widget_id')} <!-- BEGIN JIVOSITE CODE --> <!-- END JIVOSITE CODE --> {/if}