Forked from adrianspeyer/ghostery_hubspot_message.js
Last active
June 6, 2018 09:22
-
-
Save davidDuymelinck/efb26e1e23801d464aad1ff378d7ec94 to your computer and use it in GitHub Desktop.
How to handle Ghostery blocking your HubSpot forms. This appends a message asking user to add your site to whitelist. Just add it to the footer in any HubSpot COS page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).load(function () { | |
if($('.hs_cos_wrapper_type_form input[type="text"]').length === 0) { | |
var lang = $('html').attr('lang'); | |
var msg = 'If you are seeing this message you may have Adblock or Ghostery enabled. Please consider enabling Hubspot forms.'; | |
switch(lang) { | |
case 'nl': | |
case 'nl-be': | |
msg = 'Als je deze booschap ziet heb je waarschijnlijk Adblock of Ghostery. Gelieve Hubspot forms toe te laten.'; | |
break; | |
} | |
$( ".hs_cos_wrapper_type_form" ).html( "<h6>" + msg + "</h6>" ); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment