Multi-channel conversions report in Power BI

Hello there! We know that a user not always makes a desired action on a website during the first session. When taking a decision, a user can interact with different advertising medium.

Turns out, in Clickhouse you can easily prepare data for the multi-channel conversions report. As an example, you can download raw sessions data from Yandex.Metrika. In Renta you can do it in a couple of clicks.

In the Sessions table there are plenty of data, including clientID, lastTrafficSource and dateTime: Let us run the table query:

select clientID ,
groupArray( lastTrafficSource ) as Sources
from (
select clientID, dateTime, lastTrafficSource
from renta.ym_logs_dataset_1192929336
order by clientID, dateTime
group by clientID

As a result, we will get aggregated advertising medium for each clientID.

Import the table in Power BI

The data model is already compiled in this example, therefore it is easiest to build bridges between tables or combine them using clientID. That might have been the end of it, but the Source column contains characters which visually make the report heavier.

To get rid of them, you need to make some changes in the Power Query mode:

  1. Replace double brackets by blanks.
  2. Add a space after a comma.

After manipulations with data we can set about reporting. All available measures in the Power BI projects are also available at the level of aggregated advertising medium.

Some useful links:

  1. Documentation on deployment of Clickhouse on the server. It takes less than 15 minutes. Everyone can do it on the first try even if someone never heard anything about the command line.
  2. Documentation on Yandex.Metrika Logs API. Please consider this tool if you need to gather raw data.

If you have any questions left — ask them in the Comments.