• Resolved joycekwc

    (@joycekwc)


    I recently installed the plugin for Plausible Analytics and discovered an incompatibility with SG Optimizer. Its documentation noted it but the link went nowhere, but I found on Twitter a way to work around it for now – disable the Combine JS option (the thread reported the same issue with Fathom Analytics too). I don’t really want to disable this for all the Javascript scripts, though, but it’s not an option to ‘exclude from’ in the Exclude from box. Anyway to enable this?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support daniellaivanova

    (@daniellaivanova)

    Hello @joycekwc,

    If the script you are trying to exclude is not present in the drop-down menu, you can exclude it by using SG Optimizer’s filters. You may find an example of code that can be used to exclude a certain script from the JS combination below:

    add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
    function js_combine_exclude( $exclude_list ) {
        $exclude_list[] = 'script-handle';
        $exclude_list[] = 'script-handle-2';
        return $exclude_list;
    }

    Best Regards,
    Daniela Ivanova

    Thread Starter joycekwc

    (@joycekwc)

    Thanks Daniela. I have tried this and followed the instructions, including on how to find the right handle name, but still not seeing the option (and have purged SG cache and cleared browser cache too).

    Plugin Support Georgi Ganchev

    (@georgiganchev)

    Hello @joycekwc,

    You can contact the developers of the Fathom Analytics and see if they can provide you with the handles that you should exclude.

    Best regards,
    Georgi Ganchev

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Allow option to exclude analytics javascript froom Combine Javascript option’ is closed to new replies.