TNT Growth Documentation

website·Indexed 32 days ago

https://docs.tntgrowth.io/

Documentation for TNT Growth's conversion infrastructure, including the Conversion API for submitting offline conversion data to platforms like Google Ads, Meta, LinkedIn, TikTok, Reddit, Bing, and OpenAI. Includes guides for pixel installation via flexInit(), Salesforce integration using Change Data Capture (CDC), and the conversion delivery portal.

Tokens
20.7K
Snippets
75
Records
139
Agent score
7%

What's inside TNT Growth

  1. Overview of supported advertising platforms for Conversion API

    The TNT Growth Conversion API supports submitting offline conversion data to the following platforms:

    • Google Ads: Submit conversions and check status.
    • Meta (Facebook): Server-side events with user matching.
    • Reddit: Offline events with click ID attribution.
    • TikTok: Events API conversions with user matching.
    • LinkedIn: Conversions with first-party tracking.
    • Bing (Microsoft Ads): Offline conversions via Microsoft Click ID or hashed email/phone.
    • OpenAI: Conversion events with attribution references and user matching.
  2. Overview of TNT Growth Salesforce Integration via Change Data Capture (CDC)

    TNT Growth integrates with Salesforce using Change Data Capture (CDC). This allows the system to automatically trigger ad platform conversions in real-time when specific Salesforce records are updated, such as when an Opportunity moves to a 'closed' stage.
  3. Overview of Fuse conversion infrastructure

    Fuse is a conversion infrastructure designed to capture ad click identifiers (e.g., gclid for Google, msclkid for Microsoft, fbclid for Meta) from landing URLs and ensure they are delivered back to the respective ad platforms when a conversion event (like a form submission or closed deal) occurs. This prevents attribution loss caused by redirects or CRM limitations.
  4. Overview of Fuse Attribution Tracking

    Fuse prevents conversion loss by carrying the click ID from the initial ad click through a user's CRM and back to the respective ad platform. This ensures that leads closing weeks after the initial interaction are correctly attributed to the campaign that generated them.
  5. Understand the TNT Growth CDC data flow

    TNT Growth uses a real-time asynchronous flow to trigger ad conversions without manual uploads or batch processing:

    1. A Salesforce record change occurs (e.g., Opportunity Stage changes to "Closed Won").
    2. Salesforce publishes a CDC event.
    3. TNT Growth receives the event in real-time.
    4. TNT Growth reads the record to extract click IDs (GCLID, FBCLID, etc.), hashed email/phone for matching, and metadata for attribution.
    5. Conversions are fired to the configured ad platforms (Google Ads, Meta, LinkedIn, etc.).
    Salesforce record changes (e.g., Opportunity Stage → "Closed Won")
        ↓
    Salesforce publishes a Change Data Capture event
        ↓
    TNT Growth receives the event in real-time
        ↓
    TNT Growth reads the full record to extract click IDs (GCLID, FBCLID, etc.)
        ↓
    Conversions are fired to the configured ad platforms (Google Ads, Meta, etc.)
  6. Install the TNT Growth pixel script

    The TNT Growth pixel is a JavaScript bundle that captures campaign attribution from URLs and reports conversion events. To install it, load the bundle in the <head> of your website before any other scripts that call it. If using a tag manager, the script must be loaded on all pages to ensure attribution is captured on the landing page and available on the conversion page.
    <script src="https://YOUR-PIXEL-HOST/flex-pixel.js"></script>
  7. Verify TNT Growth pixel installation and event tracking

    To verify that the TNT Growth pixel is correctly installed and tracking events, follow these steps:

    1. Load a page containing a campaign parameter (e.g., ?utm_source=test&gclid=test123).
    2. Check the browser console for window.flexInitialized. It must be true. If false, verify the configuration request, hostname registration, account settings, consent state, and script errors.
    3. Trigger an event by submitting a watched form or calling flexTrack.
    4. Monitor the browser Network tab for a request to the TNT Growth API. Ensure the response status is a success (not 4xx or 5xx), as only success responses indicate the event was accepted and queued.
    5. Confirm with a TNT Growth contact that the conversion reached the ad platform, as platform delivery occurs after the event is queued.
  8. Initialize the TNT Growth pixel using hostname lookup

    Call flexInit() once per page load. In this 'inferred' mode, the pixel uses the registered HTTPS hostname to automatically load platform configurations from Flex. Ensure all hostnames (including landing pages) are registered before installation. Initialization is complete when window.flexInitialized becomes true.
    <script>
      flexInit();
    </script>
  9. Implement Enhanced Conversions for Google Ads

    Enhanced conversions allow Google Ads to match conversions using user identifiers when a click identifier (GCLID, GBRAID, or WBRAID) is missing.

    Prerequisite: You must enable 'Enhanced conversions for leads' in your Google Ads account under Goals > Conversions > Settings. If not enabled, requests containing only email/phone identifiers will fail with an "enhanced conversions not enabled" error.

    Hashing Options:

    1. Raw Values (Recommended): Send plain email and phone numbers. The system automatically lowercases/trims emails and formats phones to E.164 international standard before SHA-256 hashing.
    2. Pre-hashed Values: Send 64-character hex SHA-256 hashes. The system auto-detects these and uses them as-is.
    // Option 1: Raw values
    {
      "email": "User@Example.com",
      "phone": "415-555-2671"
    }
    
    // Option 2: Pre-hashed values
    {
      "email": "a1b2c3d4e5f6...64_char_sha256_hash",
      "phone": "f6e5d4c3b2a1...64_char_sha256_hash"
    }
  10. Troubleshoot common TNT Growth pixel issues

    Use the following guide to diagnose common symptoms during TNT Growth pixel implementation:

    • No events recorded: Verify flexInit execution, user consent state, and the result of the configuration request.
    • Events for one platform missing: Check if the account is missing in Flex or was omitted from the explicit legacy snippet.
    • Form never captures: Ensure the formIdentifier exactly matches the form's id or name attribute.
    • Attribution lost mid-funnel: If the user moves to a different domain, use flexUrlParamSync to maintain attribution.
    • Google reports no user-provided data: Check if Enhanced Conversions are disabled or if the email/phone fields were not captured.
  11. Handle timing when reading attribution cookies

    Cookies are only available after the pixel has initialized. Reading them too early will return null. There are two recommended patterns to ensure the pixel is ready:

    1. On Submit: Read the cookie inside the form submit handler rather than at page load.
    2. After Initialization: Use a polling mechanism to wait for window.flexInitialized to become true.
    // Pattern 1: On Submit
    const form = document.querySelector('#contact-form');
    form.addEventListener('submit', () => {
      const field = form.querySelector('input[name="gclid"]');
      if (field) {
        field.value = readFlexCookie('gclid') ?? '';
      }
    });
    
    // Pattern 2: After Initialization
    function whenPixelReady(callback, { maxAttempts = 20, interval = 300, onTimeout } = {}) {
      if (window.flexInitialized) {
        callback();
        return;
      }
    
      if (maxAttempts <= 0) {
        onTimeout?.();
        return;
      }
    
      setTimeout(() => whenPixelReady(callback, { maxAttempts: maxAttempts - 1, interval, onTimeout }), interval);
    }
    
    whenPixelReady(() => {
      console.log('campaign:', readFlexCookie('utm_campaign'));
    });
  12. Submit offline conversions to Microsoft Advertising (Bing)

    Submit offline conversions by sending a POST request to /api/bing/conversions/offline/add.

    Requirements:

    • You must provide at least one identifier: microsoftClickId, email, or phoneNumber. Requests missing all three will return a 400 Bad Request.
    • email and phoneNumber are used for Enhanced Conversions and are hashed before being sent to Microsoft.
    • conversionTime must be a Unix timestamp in seconds.
    curl -X POST https://flex.tntgrowth.io/api/bing/conversions/offline/add \
      -H "Content-Type: application/json" \
      -H "x-api-key: YOUR_API_KEY" \
      -d '{
        "customerAccountId": "B012345678",
        "conversionName": "Offline Purchase",
        "microsoftClickId": "abc123def456ghi789",
        "conversionTime": 1778043599,
        "conversionValue": 150,
        "email": "customer@example.com",
        "phoneNumber": "+15551234567",
        "tntId": "9f2b7c1e-4d3a-4f8b-9c2e-1a5d7e0b4c63",
        "utmSource": "bing",
        "utmMedium": "cpc",
        "utmCampaign": "brand-search-q2",
        "utmTerm": "best treatment center",
        "utmContent": "expanded-text-ad-variant-b"
      }'