📖
Public docs
  • LeadBoxer — Lead Data Platform —Documentation
  • 🛠️Getting Started
  • Lead Management Workflow
    • Cold outbound email campaigns
  • How does it all work?
  • Fundamentals
    • Inboxer
    • Leads & Accounts
      • Lead card: Complete lead details in one page
      • Batch operations
    • LeadBoard
    • Reports
    • Elements
      • Filters
      • Segments
      • Workflow Automation
      • Notifications
      • Users
      • Datasets
      • Clients (agents)
      • Lists
      • Enrichment
      • Leadscore
      • Lead & Account Tags
      • Import & Export
        • Upload Leads
        • download data
        • LinkedIn Matched Audiences export
        • Custom Properties
        • LeadBoxer User Interface Placeholder Names
      • Roles & Permissions
      • Goals & Targets
      • LeadBoxer Credits
    • Definitions & Glossary
  • 🧩Integrations
    • 🌐Website
      • Lead Tracking Pixel
      • WordPress plug-in
        • track my WordPress user logins?
      • Google Tag Manager (GTM)
      • Drupal module
      • Gravity Form Tracking
      • Change website content based on behaviour
      • Track meta data using JSON-LD
      • Cross device tracking
      • Tracking marketing campaign data (UTM tags)
      • UTM tags for Google Adwords
      • How to track user logins
      • Automatic form tracking
      • Manual form tracking
      • How to get (raw) lead data
      • Magento
      • Adobe Tag Manager
      • Unbounce landing pages
      • Tracking pixel into Wix
    • ✉️Email
      • Individual emails
        • Gmail Email tracking
        • G Suite email tracking
        • Official Outlook Add-in
        • Advanced Outlook Add-in
        • Manually Identify leads using email
        • Legacy Outlook plugin
        • Linkedin InMail or Invite Link Tracking
      • marketing emails
        • 1. Setup Tracking Pixel
        • 2. Track Email Opens
        • 3. Track Email Clicks
        • Mailchimp
        • HubSpot
        • Sharpspring
        • ActiveCampaign
        • Pipedrive Campaigns
        • Eloqua
        • Copernica
        • Intercom
        • Mailup
        • Brevo
        • Poppulo
        • Reply.io
        • Spotler mail+
        • Prospect.io
        • Woodpecker
        • Instantly
        • Mailerlite
        • Lemlist
        • Autopilot
        • Constant Contact
        • dotdigital
        • Apollo.io
        • LaPosta
        • Customer.io
        • Campaign Monitor
        • QuickMail
        • Outreach
        • Mail Merge (MS Word)
    • Other
      • Active Campaign
      • HubSpot
      • Marketo
      • LinkedIn
        • LinkedIn job titles search
      • Google Places
      • Calendly
      • How to get LeadBoxer data into Intercom
      • Zapier
        • Advanced Zapier usage
        • Zapier webhook
        • Connect Leadboxer to Pipedrive with Zapier
        • Connect Leadboxer to Slack with Zapier
        • Connect Leadboxer to Salesforce with Zapier
      • Pipedrive
        • Pipedrive Workflow Automation with LeadBoxer
      • Whatagraph
      • Google BigQuery
      • Single Sign On (SSO)
  • 🦮Guides
    • Creating your first Segment
    • Creating your first LeadBoard
    • How to add a user
    • How to upload a List (ABM)
    • How to add a datasets
    • How to create a notification
    • How to set your Leadscore
    • How to hide & unhide Leads
    • Filter Leads from ad campaigns
    • How to create a Workflow Automation
    • How to mask IP addresses
  • 🏆Solutions
    • Lead Identification
    • Lead Qualification
    • Lead Managment
  • Extras
    • Changelog
    • Email tracking info
    • linkedIn industries
    • LeadBoxer reseller getting started
    • How to contact leads
    • LeadBoxer cookies
  • Terms of Service
  • Privacy Policy
Powered by GitBook
On this page
  1. Integrations
  2. Website
  3. WordPress plug-in

track my WordPress user logins?

PreviousWordPress plug-inNextGoogle Tag Manager (GTM)

Last updated 2 years ago

How to track user logins on my WordPress website

In order to track user logins form your website, you need to add the data to the user profile:

There are multiple ways to achieve this but we recommend to use a plugin called . Code Snippets allows you to add code to your site without the need to mess around with templates, etc

Once you have installed the plugin, simply create a new snippet and add this code:

function hook_javascript() {

?>
<script type="text/javascript" src="//script.leadboxer.com/?dataset=YOUR DATASETID HERE"></script>		
    <?php
		};

function hook_identification() {

	$user_info  = wp_get_current_user();
	$user_email = $user_info->user_email; 
	$user_firstname = $user_info->user_firstname; 
	$user_lastname = $user_info->user_lastname; 
?>
		
<script type="text/javascript">

	// define an empty variable called 'map' 
	var map = new OTMap();

	//define one or multiple properties to be added to the visitor profile 
	map.put("firstName", "<?php echo $user_firstname; ?>"); 
	map.put("lastName", "<?php echo $user_lastname; ?>"); 
	map.put("email", "<?php echo $user_email; ?>"); 


	//send (submit) the data to LeadBoxer 
	OTLogService.sendEvent("Login added", map, false);

</script>
    <?php
		}
	
function lb_function()
{
    if ( is_user_logged_in() ) 
    {
        add_action('wp_head', 'hook_identification');
    }
}

add_action('wp_head', 'hook_javascript');
add_action('init', 'lb_function');<br>

Paste the above inside the snippet to to send us a signal when a user logs in to your system. This will add that first and lastname and email address to the visitor profiles. You can use any data available like usernames, LoginID, etc.

Notes:

  • Replace the datasetID with your own

  • Enable the snippet to run everywhere.

  • And don't forget to disable the regular LeadBoxer Wordpress plugin, or remove the tracking pixel from your templates, etc. as it is included in the above script.

Still need help? Contact Us

Last updated on July 30, 2019

🧩
🌐
Code Snippets