Setup custom events

Setup BooleanMaths supported custom events

Overview

Custom event tracking enables you to monitor and analyze user interactions, business metrics, and application behavior by capturing specific events throughout your system. This feature provides the flexibility to track any custom action or milestone that matters to your business.

How it works

Prerequisites

Pulse must be installed on your website using the custom pixel code snippet. If you haven't installed it yet, please check the installation guide first.

Implementation by Platform

Shopify Websites

No additional setup required - Our Shopify plugin automatically manages all required events for Shopify stores.

Non-Shopify Websites

Custom events implementation involves two layers:

  1. Data Layer: Collect and prepare business data for tracking and analysis

  2. Event Endpoint: Send the prepared data to BooleanMaths

Example: Form Tracking Implementation

Let's implement form tracking using the FormFilled event:

Parameter
Type
Description
Example

form_name*

string

Name of target form

Peter Parker

form_data*

Json

Form details filled by user

{ "email": "example@gmail.com", "name" : "Peter Parker", }

conversion_value

float

Conversion value

10

Note: '*' fields are required to identify user. All other fields are optional

FormFilled event accepts above data values. For data layer we need to write some custom code so that we can connect data with this event.

Important Note: The custom event code snippet in the <script> tags must load after the Pulse snippet. This approach works for all JavaScript-based projects.

WordPress Implementation

For wordpress managed projects you need to add BooleanMaths pulse snippet to all pages, so that we can access it all over the site.

Step 1: Install Pulse Snippet Site-Wide

Add the BooleanMaths Pulse snippet to all pages for site-wide access.

Installation Options:

Option A: Insert Headers and Footers Plugin

  1. Go to WordPress Admin → Plugins → Add New

  2. Search for "Insert Headers and Footers" or "Code Snippets"

  3. Install and activate the plugin

  4. Go to plugin settings (usually under Settings or Tools)

  5. Paste your Pulse code in the header section

  6. Save changes

Option B: WPCode Plugin (Recommended for Page-Specific Events)

  1. Install WPCode: Go to Plugins → Add New, search for "WPCode", install and activate

  2. Add new snippet: Navigate to WPCode → Add Snippet and click "Add Your Custom Code (New Snippet)"

  3. Choose code type: Select the appropriate type (HTML, CSS, JavaScript, PHP)

  4. Target specific pages: In the "Location" section, select "Page" and choose your target page

  5. Insert and save: Paste your code and click "Save Changes"

Step 2: Add Custom Event Code

After installing the Pulse snippet, add your custom event code using the same approach as other JavaScript sites:

  1. Create a code snippet with your event tracking logic

  2. Add it to your WordPress site's footer section

  3. For page-specific events, add the code only to relevant pages using the WPCode plugin's targeting feature

Best Practices

  • Always ensure the Pulse snippet loads before your custom event code

  • Test your implementation thoroughly before deploying to production

  • Use descriptive event names and consistent data structures

  • Monitor your events in the BooleanMaths dashboard to verify proper tracking

https://www.loom.com/share/806f9bea9abc4377bf0835815daa3296?sid=1c4233c4-1df1-4d37-9f7a-2ca6883aeb04

Last updated