How to send analytics data with custom marketing destination

Explore how you can transfer your analytics data wherever you want with Hardal Signal.

ME
Mert Enercan
Developer
13.01.2025

Greetings, mighty internet.

Today, I'd like to make a guidance about how you can transfer any kind of web events to literally any platform you want with Hardal Signal’s Custom Destinations feature that is published with version 1.0.4.

Basically, you can forward incoming request to any kind of service that is accepts http POST and GET requests. The craziest part is, you can manage payload format as well!

It all starts with clicking “Add Destination” button that is placed on your Signal’s Connection tab. You’ll encounter with this dialog below 👇

You may also use built-in templates!

  • Endpoint Label: Display Name of your connection

  • Endpoint ID: Unique identifier for your connection

  • Endpoint URL: Destination URL that data will sent

  • Request Method: HTTP Request method

  • Content Type (POST Method Only): You can select either *application/json *or *application/x-www-form-urlencoded *option for your Content-Type Header

  • Request Format (POST Method Only): This is the payload format that can be shaped with your destinations requirements. You can use build-in variables to form all kind of JSON format to use.

  • Query Parameters (GET Method Only): And this one stands for defining your query parameters within get requests. You can also use variables for this one!

  • Additional Headers: You can specify custom headers. This is the place that you want to take a look if your server has some kind of authentication mechanism.

Now I'll be creating 3 custom destination to cover all the possible ways of transfer my data on server-side. Here goes my configs

So this one works with http GET request. I set 3 query parameters. En stands for event_name, dt is device type and lastly timestamp is created_at value of event.

I am using same values for http POST request as well. In this example, i wanted to demonstrate how you can manage your JSON format with nested structure.

And lastly, there is an additional option for post request in form of www-form-urlencoded. The thing is, you can still define your format in JSON format but it'll automatically convert it for url-encoded on server-side.

Only thing i need to do is drag a line between my Signal and my custom defined API endpoints, and it's ready to go!

As you can see down below, i am successfully receiving my own analytics data with Hardal Signal SDK

This how it looks in browsers network tab. You may see pushed destination id list as a response. I also shared server logs that i created on glitch for this article

Let us cook ️‍🔥

Peace.