Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidDuymelinck/efb26e1e23801d464aad1ff378d7ec94 to your computer and use it in GitHub Desktop.
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.
$(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