Title: ahrefs analytics
Last modified: February 6, 2025

---

# ahrefs analytics

 *  [Ilari Arovuo](https://wordpress.org/support/users/iarovuo/)
 * (@iarovuo)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/ahrefs-analytics/)
 * It seems the plugin “eats” the ahrefs analytics script from the Divi Theme Head
   Integrations section.
 * It’s due Combine JavaScript Files – and you cannot exclude a script from combination,
   which is set in the Divi Integrations Head section.
 * Only option is to disable js combination

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

 *  Thread Starter [Ilari Arovuo](https://wordpress.org/support/users/iarovuo/)
 * (@iarovuo)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/ahrefs-analytics/#post-18290478)
 * The snippet looks like this:
 *     ```wp-block-code
       <script src="https://analytics.ahrefs.com/analytics.js" data-key="<redacted>" async></script>
       ```
   
 * The script is placed in Elegant Themes Divi Theme Theme Options, Integrations
   <head> section. But, the siteground speed optimizer javascript combiner eats 
   the whole script. and there is no way to exclude it.
 *  Plugin Support [Georgi Ganchev](https://wordpress.org/support/users/georgiganchev/)
 * (@georgiganchev)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/ahrefs-analytics/#post-18290664)
 * Hello [@iarovuo](https://wordpress.org/support/users/iarovuo/),
 * If you do not see the script in the Exclude option under the plugin you can use
   one of our custom filters to exclude JS scripts from combination applied in the
   theme’s functions.php file.
 * The filters are present here:
 * [https://eu.siteground.com/tutorials/wordpress/speed-optimizer/custom-filters/](https://eu.siteground.com/tutorials/wordpress/speed-optimizer/custom-filters/)
 * You can **exclude an external script from being combined** using the filter we’ve
   designed for that purpose. Here’s an example of the code you can add to your **
   functions.php** file:
 *     ```wp-block-code
       add_filter( 'sgo_javascript_combine_excluded_external_paths', 'js_combine_exclude_external_script' );
       function js_combine_exclude_external_script( $exclude_list ) {
         $exclude_list[] = 'script-host.com';
         $exclude_list[] = 'script-host-2.com';
   
         return $exclude_list;
       }
       ```
   
 * This will allow you to continue using the combine JS option and exclude only 
   the script that is not properly combined.
 * Best regards,
   Georgi GanchevSiteGround.com
 *  Thread Starter [Ilari Arovuo](https://wordpress.org/support/users/iarovuo/)
 * (@iarovuo)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/ahrefs-analytics/#post-18335591)
 * That worked! but why is the plugin targeting ahrefs, and simply obliterating 
   the snippet, without asking, without warning, without a note. … Took me quite
   a while find out that it’s this plugin INTENTIONALLY targeting ahrefs.

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

The topic ‘ahrefs analytics’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [combination](https://wordpress.org/support/topic-tag/combination/)
 * [js](https://wordpress.org/support/topic-tag/js/)
 * [web analytics](https://wordpress.org/support/topic-tag/web-analytics/)

 * 3 replies
 * 3 participants
 * Last reply from: [Ilari Arovuo](https://wordpress.org/support/users/iarovuo/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/ahrefs-analytics/#post-18335591)
 * Status: not resolved