Integrations

Integrating Convert with CallRail: A Step-by-Step Guide

Seamlessly Track Experiment Data Across Platforms with Convert and CallRail Integration

IN THIS ARTICLE YOU WILL:

Overview

Integrating Convert with CallRail allows you to feed experiment data from Convert into CallRail. This enables you to leverage the data for more detailed analysis and tracking. The integration involves sending experiment data from Convert to CallRail and configuring a webhook in CallRail to transmit this data to other platforms (e.g., analytics tools).

Prerequisites

To complete the integration, ensure you have the following:

  • Convert Account: Access to your Convert account and familiarity with its Global Project JS section.
  • CallRail Account: Access to a CallRail account with the necessary permissions to configure webhooks.

Integration Steps

  1. Insert the Convert Tracking Code

    • Place the Convert tracking code before the CallRail snippet on your webpage.
    • This ensures the experiment data is available when the CallRail script runs.
    • Verify that the tracking code is correctly implemented to avoid potential issues with data transmission.
  2. Add Custom JavaScript in Convert

    • To send experiment data from Convert to CallRail, follow these steps:
      1. Navigate to Global Project JS:
        • Go to Project > Configuration > Global Project JS in Convert.
      2. Insert the following code:
        // Function to handle the data sending to CallRail
        function sendDataToCallRail(data) {
            if (data.length > 0) {
                const experiments = data.map(item => {
                    return { experiment_id: item.expName, variant_id: item.varName };
                });
                window._cct_custom_data = {
                    'experiments': experiments
                };
                console.log("Sent data to CallRail: ", window._cct_custom_data);
            } else {
                console.error("No experiment data available.");
            }
        }

        // Convert snippet lifecycle hook for experiences evaluated
        window._conv_q = window._conv_q || [];
        window._conv_q.push({
            what: 'addListener',
            params: {
                event: 'snippet.experiences_evaluated',
                handler: () => {
                    console.log("All experiments have been evaluated");

                    // Prepare the data for each experiment and variation
                    const allData = Object.keys(convert.currentData.experiences).map(expId => {
                        const expData = convert.currentData.experiences[expId];
                        const variation = expData.variation;
                        let experimentName = convert.data.experiences.find(exp => exp.id === expId)?.name || 'Unknown Experiment';
                        return { expName: experimentName, varName: variation.name };
                    });

                    // Send data to CallRail immediately without waiting for any library
                    sendDataToCallRail(allData);
                }
            }
        });
      3. Important Notes:
        • The window._cct_custom_data object is used to capture experiment data.
        • Ensure this object is defined before the CallRail JavaScript snippet.
  3. Create a Goal in Convert

    • To register conversions in Convert:
      • Create a goal in the Convert platform.
      • Obtain the Goal ID, which will be included in Convert's tracking request.
      • This ensures that conversions are properly registered.
  4. Configure CallRail Webhook

    1. Log in to CallRail:

      • Go to the Webhooks section in your CallRail account.
    2. Set Up a New Webhook:

      • Configure a webhook to send experiment data to your desired platform (e.g., Zapier).
      • Zapier can be used to transform the webhook data into a Convert tracking request.
    3. Webhook Configuration Notes:

      • Ensure the webhook transmits the required data, such as:
        • Experiment IDs
        • Variation IDs
        • Visitor session details

Additional Considerations

Tracking Request Format

  • Use the specified format for Convert tracking requests, which should include:
    • Account ID

    • Project ID

    • Session ID

    • Event type (e.g., hitGoal for goal conversions)

Example Tracking Request

  • Make sure the tracking request includes the user-agent header to avoid HTTP 301 errors.

Conclusion

By following these steps, you can successfully integrate Convert with CallRail to enable seamless data sharing. This integration provides valuable insights into your marketing efforts by linking experiment variations with call data.


Key Notes:

  • Ensure the Convert tracking code and custom JavaScript are properly placed and executed.
  • Test the integration to verify that data flows correctly from Convert to CallRail.

If you encounter issues or need assistance, don’t hesitate to reach out for further guidance.