In this article, you’ll learn how to integrate 3rd party scripts inside LeadsHook.
The most common use is tracking and analytics scripts or pixels.
Scripts Primer
For most tracking and analytics scripts there is…
1) base or global script or pixeL (like google analytics script or facebook pixel)
2) And there is a node or action specific script to fire specific events.
EXAMPLES
Facebook Pixel & Facebook Events
Google Analytics and Events
WE’LL USE A SEGMENT SCRIPT FOR THE EXAMPLE BELOW. THE PROCESS IS THE SAME FOR most SCRIPTS.
LeadsHook provides 3 ways to add 3rd Party Scripts
#1 Google Tag Manager
LeadsHook provides an integration to Google Tag Manager…
Learn more here:
# 2 Global Scripts
If there are scripts that you’ll use or apply to more than one decision tree then use the Global Scripts feature. The most common use is for a base pixel so you can apply to multiple decision trees and all nodes inside each decision tree.
Almost always, global scripts are “SET and FORGET”.



Repeat the above steps and add all of your global scripts. This will make life easy when creating decision trees.
Add Global Scripts to Your Decision Tree
Go to your decision tree and select the Global scripts you want to apply…


#3 Decision-Tree Specific Scripts


There is no need to apply decision tree specific scripts. They will be automatically applied.
NODE-LEVEL TRACKING
On every node you’ll see a TRACKING section…

You can fire any js script you want…



Types of Events
Enter: Fire when node is loaded (i.e your prospects, leads and customers see a node)
Exit: Fire when someone exits a node
Select: Fire when someone selects an answer
Deselect: Fire when someone deselects an answer
Segment.com Examples
When Your Prospects LAND on your Decision Tree…

When Your Prospects & Leads Complete your Decision Tree…

Use of Custom Fields Inside Events

Pingback: The Complete Guide to Tracking | LeadsHook Knowledge Base
Pingback: How to Setup "Custom Page" Node | LeadsHook Knowledge Base