How to report an acquisition using API

In addition to reporting conversions from the landing page, you can report retrospectively on customer acquisition. Each company can define in a different way what is considered an acquisition. This can be completion of the Signup process, app download, purchase, etc.

When a user goes from the landing page to an external link, the system transfers along with the URL a unique session ID. It looks like this:

image

When an acquisition is made further down the funnel, you can report to the BetterFunnel platform in the following way:

curl --location --request POST 'https://api.betterfunnel.ai/v1/analytics/report-conversion' \
--header 'x-api-key: {apiKey}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "sessionId": "{sessionId}",
    "event": "eventName"
}'

In your backend you need to call an API endpoint of type POST with the following data. You received the sessionId from the URL and the unique API Key you will receive from us during implementation.

Or with other identifiers, for example a gclid:

curl --location --request POST 'https://api.betterfunnel.ai/v1/analytics/report-conversion' \
--header 'x-api-key: {apiKey}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "gclid": "{gclid}",
    "event": "eventName"
}'

Use Other session identifiers:

replace the sessionId prop with one of the following

  • 1.

    hash

  • 2.

    sessionHash

  • 3.

    visitHash

  • 4.

    shortHash

  • 5.

    shortSessionHash

  • 6.

    shortVisitHash

  • 7.

    gclid

  • 8.

    fbclid

  • 9.

    msclkid

  • Report conversion value

    You can optionally pass conversion value to use for analytics inside BetterFunnel.

    curl --location --request POST 'https://api.betterfunnel.ai/v1/analytics/report-conversion' \
    --header 'x-api-key: {apiKey}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "sessionId": "{sessionId}",
        "conversion": {"value": <number-only>}
    }'
    

    The reports regarding the acquisition can be seen within the BetterFunnel system in the following way:

    image