What’s new: Integrations Update, Connection Builder, Custom Parameters in Rule’s Push Payloads, and more.Let’s see
Apphud
Why Apphud?PricingContact
Ren
Ren
April 29, 2025
6 min read

Use Case: Unlocking the Power of Apphud's Connection Builder

In today’s data-driven app ecosystem, flexible event handling is critical for accurate attribution and performance marketing. With Apphud’s Connection Builder, you can send subscription events to any third-party service.

6 min read
Use Case: Unlocking the Power of Apphud's Connection Builder

Whether you’re customizing revenue data for ad networks or routing events with specific conditions, Connection Builder gives you the power to build seamless, tailored workflows - no engineering bottlenecks required.


What is Connection Builder?

Apphud’s latest update introduces Connection Builder, a flexible tool that enables you to send subscription events to any third-party service, even if it’s not among the pre-built integrations like AppsFlyer, Meta (Facebook) Conversions API, or Amplitude.

Connections, ApphudConnections, Apphud

With Connection Builder, you can build custom integrations in just a few steps:

  • Create a new connection
  • Specify the endpoint URL
  • Add headers if needed
  • Construct a POST body using Liquid syntax macros

For example, here’s a simple POST body that sends the event name:

{
  "event_name": "{{ event.name }}"
}

Advanced Macro Support

You can use a wide range of macros to customize the request payload. Below are some useful examples:

  • {{ event.receipt.transaction_id }} – Unique transaction ID of a purchase.
  • {{ event.receipt.proceeds }} / {{ event.receipt.proceeds_usd }} – Revenue from the purchase in local currency or USD.
  • {{ user.attribution.fbc }} – Facebook Click ID (fbclid), useful for Meta’s Conversions API.
  • {{ user.click_event.properties.some_click_id }} – Any custom URL parameter from a Web-to-App campaign (e.g., some_click_id).
  • {{ user.user_properties.some_property_name }} – Custom user-defined property passed via Apphud SDK.

See the full list of macros in our Connection Builder documentation.

Connection Builder, ApphudConnection Builder, Apphud

Conditional Logic in JSON

With Connection Builder, you can embed conditional logic directly in your request body using Liquid if/else tags.

Example: Send a has_idfa flag based on the availability of IDFA:

"has_idfa": {% if user.idfa %} 1 {% else %} 0 {% endif %}

You can also apply conditions to multi-line blocks or entire JSON payloads:

{% if user.country == "US" %}
{ "region": "NA" }
{% else %}
{ "region": "Other" }
{% endif %}

Value Modifiers

Transform values on the fly using built-in modifiers. Examples include arithmetic operations, string formatting, and date formatting.

Arithmetic:

"revenue_x2": {{ event.receipt.price | times: 2 }}

String case formatting:

"product": "{{ event.receipt.product_id | upcase }}"

Date formatting:

"event_time": "{{ event.created_at | date: "%Y-%m-%d %H:%M:%S.000" }}"

UNIX timestamp:

"timestamp": "{{ event.created_at | date: "%s" }}"

For more on date formatting, check this Liquid guide.


Event Filters

Event filters, ApphudEvent filters, Apphud

Add powerful event filters to ensure only specific data is sent to a destination. For example:

  • Revenue > $29
  • Product duration = Weekly
  • Trial started = true

These filters can be applied per connection for precise control.


Use Cases

Here are some popular ways to use Connection Builder:

1. Customize Revenue for Ad Networks

Marketers often want to control what value is passed to ad platforms - for instance, assigning a custom value to free trials or inflating revenue to reflect LTV.

"value": {% if event.receipt.trial_period %} 10 {% else %} {{ event.receipt.price | times: 2.5 }} {% endif %}

This sends 10 for trial conversions and 2.5x the original price for standard purchases.

2. Forward Annual and Weekly Purchases Differently

To optimize for annual plans in Meta Ads or another platform, you might want to rename those events.

Option 1: Use conditional logic in a payload

"event_name": {% if event.receipt.price_usd > 20 %} "annual_purchase" {% else %} "{{ event.name }}" {% endif %}

Option 2: Create two separate connections with filters

Connection A

Filter: Product Duration = Yearly

Body: "event_name": "annual_purchase"

Connection B

Filter: Product Duration != Yearly

Body: "event_name": "{{ event.name }}"

3. Send Predicted LTV for Smarter Ad Optimization

These macros are available by request only. Please contact Apphud support to enable them for your account.

Developers can enhance ad campaign performance by passing predicted LTV (Lifetime Value) instead of actual revenue. Apphud supports special macros:

  • {{ user.pltv_30d }} – Predicted LTV over 30 days
  • {{ user.pltv_365d }} – Predicted LTV over 365 days

Example:

"value": {{ user.pltv_30d }}

This allows ad networks to optimize for high-value users even before full revenue is realized.

4. Forward Custom Click IDs to Ad Networks

If you're working with custom ad networks, you can pass your own click IDs for improved attribution.

There are two main ways to do this:

Option 1: Using user properties

If you save custom click IDs via the Apphud SDK or API:

"value": {{ user.user_properties.custom_click_id }}

Option 2: Using Web-to-App campaigns

If you're using Apphud’s Web-to-App solution, you can capture and forward click parameters directly from the original click event:

"value": {{ user.click_event.properties.custom_click_id }}

This is particularly useful for custom attribution pipelines where you want to track ad performance using your own identifiers.


Conclusion

Apphud’s Connection Builder gives you complete control over how, when, and what data you send to any third-party platform. It’s designed for marketers, developers, and data engineers who need flexible workflows for attribution, analytics, and custom event handling, without being limited to built-in integrations.

Ready to build your first connection? Explore the full documentation here and sign up to Apphud today!

Ren
Ren
Co-founder at Apphud
Ex iOS app and game developer. 11 years in the industry since iOS 3. More than 50 apps are in the background with 4 exits. Entrepreneur and traveler.

Related Posts