*Limited Launch Offer!Use code for 50% off (expires 12/31/2025)

Analytics & Conversions

Analytics & Conversion Tracking

SlappShell serviceCRM includes built-in support for Google Tag Manager (GTM) to help you track analytics and conversions effectively.

To set up your GTM connect, simply add your GTM ID to the /config/business.ts file in the analytics section.

After that, you can manage all your tags, triggers, and variables directly from the GTM dashboard.

Conversion Tracking

One of the main reasons we created SlappShell serviceCRM was to improve the performance of lead-gen campaings with simple conversion tracking.

There are two primary conversion events that are all ready to go and are sending detailed data the the data layer for you to use in GTM:

  1. Lead Submitted: Triggered when a lead submits a contact or lead form. This event includes details such as lead type, service interest, and form data. You can edit the value of this conversion
  2. Lead Conversion: Triggered when a lead is completed and has paid their final invoice. This event includes lead information and a dynamic conversion value.

The key to all of this is so that you can easily send accurate conversion values back to your ad platforms like Google Ads and Facebook Ads to optimize your campaigns for actual business results.

To customize the conversion values, simply edit the leadSubmissionsValue and conversionDefaultValue settings in the /config/business.ts file.

Using the Data Layer in GTM

To make use of your apps tracking data in GTM for tags and triggers, you can create the following data layer variables:

The main variables you'll use include:

  • Variable Name: DLV - Event Category
  • Variable Type: Data Layer Variable
  • Data Layer Variable Name: event_category
  • Variable Name: DLV - Event Action
  • Variable Type: Data Layer Variable
  • Data Layer Variable Name: event_action
  • Variable Name: DLV - Event Label
  • Variable Type: Data Layer Variable
  • Data Layer Variable Name: event_label
  • Variable Name: DLV - Event Value
  • Variable Type: Data Layer Variable
  • Data Layer Variable Name: value

You can then create triggers based on "lead_sumbission" and "lead_conversion" events to fire your conversion tags accordingly.

e.g:

Trigger Type: Custom Event

Event name: lead_submission

The full data layer structure for each event can be found below and customized in /lib/utils/gtm.ts.

Data Layer Structure

// Lead Submitted Event
{
    'event': 'lead_submission',
    'event_category': 'Lead Generation',
    'event_action': 'Form Submit',
    'event_label': leadData.leadType,
    'value': businessConfig.analytics.leadSubmissionsValue || '10',
    'lead_data': {
      'lead_type': leadData.leadType,
      'lead_id': {Date.now()}_{leadData.email}, // Temporary ID until we get the real one
      'email': leadData.email,
      'phone': leadData.phone,
      'first_name': leadData.firstName,
      'last_name': leadData.lastName,
    },
    'traffic_source': {
      'source': leadData.utm_source || 'direct',
      'medium': leadData.utm_medium || 'none',
      'campaign': leadData.utm_campaign || 'none',
      'term': leadData.utm_term || null,
      'content': leadData.utm_content || null,
      'gclid': leadData.gclid,
      'fbclid': leadData.fbclid,
      'msclkid': leadData.msclkid,
    },
    'ecommerce': {
      'currency': 'USD',
      'value': businessConfig.analytics.leadSubmissionsValue || '10',
      'items': [{
        'item_name': {leadData.leadType}_lead,
        'item_category': 'Lead Generation',
        'item_category2': leadData.leadType,
        'price': businessConfig.analytics.leadSubmissionsValue || '10',
        'quantity': 1
      }]
    }
  }

// Lead Conversion Event

{
    'event': 'lead_conversion',
    'event_category': 'Lead Generation',
    'event_action': 'Lead Converted',
    'event_label': lead.leadType,
    'value': conversionValue,
    'conversion_data': {
      'lead_id': lead.id,
      'lead_type': lead.leadType,
      'email': lead.email,
      'status': lead.status,
      'conversion_value': conversionValue
    },
        'traffic_source': {
      'source': lead.utm_source || 'direct',
      'medium': lead.utm_medium || 'none',
      'campaign': lead.utm_campaign || 'none',
      'term': lead.utm_term || null,
      'content': lead.utm_content || null,
      'gclid': lead.gclid,
      'fbclid': lead.fbclid,
      'msclkid': lead.msclkid,
    },
    'ecommerce': {
      'currency': 'USD',
      'value': conversionValue,
      'transaction_id': conv_{lead.id},
      'items': [{
        'item_name': {lead.leadType}_conversion,
        'item_category': 'Lead Conversion',
        'item_category2': lead.leadType,
        'price': conversionValue,
        'quantity': 1
      }
              

See /lib/utils/gtm.ts for full implementation