• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to user navigation

PopWP

WordPress and Genesis Tutorials

  • Get Started
  • About
  • Archive
  • Services
  • Membership
  • My Account

Install HubSpot on WordPress site

Last Updated on August 19, 2019 Favorited: 0 times

This tutorial provides the steps to setup and install HubSpot CRM chat widget in WordPress site similar to what we have on Designody.

You can use the Plugin and Install it by following the tutorial.

STEP 1

Click on Conversations > Chatflows and  Edit your Chat widget.

STEP 2

At the same Page on Conversations > Chatflows. Click on More and Go to inbox settings.

STEP 3

Now Customize and Click on Tracking Code and Copy it.

STEP 4

It is the time to Install the code. You can paste it in Header or Footer script section of your theme or can download a plugin to put it. Like I made a quick search https://www.google.com/search?q=header+footer+script+plugin

Customization

The default setup will show Hubspot chat on all pages if no condition is set for all users. It is possible to hide and show it based on WordPress conditional tag but it’s not come by default in Hubspot.

If you are looking for manual configuration and restrict the Hubspot CRM code for some specific members then this will work best.

OPTION 1. For all users but Not for Admin

Add the following code in functions.php

//* Add hubspot chat before closing <body>
add_action( 'wp_footer', 'dy_hubspot_chat', 100 );
function dy_hubspot_chat() { 
	if ( current_user_can('administrator') ) {
        return;
    }

	?>

	<!-- Start of HubSpot Embed Code -->
	<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/6055630.js"></script>
	<!-- End of HubSpot Embed Code -->
	
<?php }

OPTION 2. For Logged-in users Not for general visitors.

Add the following code in functions.php

//* Add hubspot chat before closing <body>
add_action( 'wp_footer', 'dy_hubspot_chat', 100 );
function dy_hubspot_chat() { 
	if ( ! is_user_logged_in() ) {
        return;
    }

	?>

	<!-- Start of HubSpot Embed Code -->
	<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/6055630.js"></script>
	<!-- End of HubSpot Embed Code -->
	
<?php }

Use only one option. Replace the

	<!-- Start of HubSpot Embed Code -->
	<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/6055630.js"></script>
	<!-- End of HubSpot Embed Code -->

with your code.

Plugin:

https://wordpress.org/plugins/leadin/

Documentation:

https://knowledge.hubspot.com/articles/kcs_article/integrations/install-the-hubspot-wordpress-plugin

https://knowledge.hubspot.com/articles/kcs_article/reports/install-the-hubspot-tracking-code

Related Posts

  • Install Drift on WordPress site

Categories: Free Content, Genesis Tutorials, WordPress Tutorials Tags: chat, hubspot

Reader Interactions

Primary Sidebar

Search

WPEngine WordPress Hosting, Perfected.

Hosting You are looking for?.
Perfect solution for small business to global enterprise.

Learn more

StudioPress Genesis Theme Framework

The No.1 Theme Provider.
Creative, SEO rich Theme for all niche projects.

Learn more

Categories

  • Free Content
  • Genesis Tutorials
  • Premium Content
  • Snippets
  • What's New?
  • WordPress Tutorials

Tag Cloud

Archive Background Section blog canvas menu center logo columns conditional tags CSS CSS Grid custom Customizer custom post type Custom Post Types custom template Custom Widget effect eNews Extended Featured Image front-page Genesis Genesis Sample header right hero section Image Background js layout left menu Logo menu Navigation Menu newsletter post page related posts responsive menu search search widget Shrinking Logo site header slide in-out Stylesheet Template Utility Bar Video Background widgets WordPress

Built with Genesis Framework + WordPress by Aryan Raj

  • Contact
  • FAQ
  • Disclaimer
  • Privacy Policy
  • Copyright Policy
  • Terms of Service