If you want to use Adthena data in your Power BI reports, you can do this by streaming the data directly into your Power BI report.
To use Power BI as described in this tutorial, you must:
- Use Windows operating system
- Have Power BI desktop installed
Step 1: Available data
All data available in the API can be used in Power BI - to see details on what is available in the API please see our API documentation.
Step 2: API URLs
When using the API and adding new web URLs to Power BI, each URL will always start with: https://api.adthena.com/wizard/YOUR_ACCOUNT_ID/
For example, if your account id is 111, then the URL would be:
After this URL, you put the details of the data that you want to retrieve, which we will explain in the next section.
Step 3: Reading the API documentation
Example: retrieving Market Share
1. Click on Market Share in the left API menu to see how to retrieve Market Share data
2. You will see the available parameters that you can use
3. Here you can see the URL that you need to use to retrieve the Market Share data. So you'll need to amend the previously mentioned URL to include /market-share/all to the URL. If your Account ID was 111, the complete URL would be:
In the next section, we will see how to use this URL and the parameters to retrieve data into Power BI.
Step 4: Get data
Start by opening Power BI desktop and click the "Get Data" button.
Step 5: Choose Web Data
Once you have clicked "Get Data", a box will open - type in "web" into the search box as shown above.
Step 6: Connect
Ensure you choose the internet web data option, and then click connect.
Step 7: Add your API details
You will now see a box pop up with two options: Basic and Advanced. Click the Advanced radio button and then click OK.
When you do that, a form will open for you to complete - we will explain how to complete this form in the next section.
Step 8: Adding your API details continued
The URL parts textbox is where we will enter the API URL details that you learned how to build in previous slides. In this example, we are retrieving market share data.
You can put your entire URL in one textbox. However, to make it easier to read, we will split the parameters into individual text boxes.
Important! The parameters that comes after the:
URL are called query parameters. The first parameter always starts with ?
All following parameters must start with &
So, for example, a completed URL for account id 111 may look like: https://api.adthena.com/wizard/111/market-share/all?device=desktop&periodstart=22023-10-01&periodend=2023-10-08
In the URL above, we are retrieving market data for desktop, starting Oct 1st and ending Oct 8th.
Next, we will learn how to put this in the form.
Step 9: Completing the Web Data form
We put the main part of our API url in the first textbox:
Now, we put the rest of the parameters that we would like to use in the rest of the boxes.
You can keep clicking the “Add Part” button to add more. You can add search terms, groups, and anything else you see available in the API documentation.
In this example we will only add device, and then start and end dates.
Remember, the first parameter always starts with ?, and all following parameters must start with &
So, here we have added our device parameter in the box under the URL
Then, we have added our next parameters in the following boxes:
Step 10: Authentication
We have now completed the URL parts that let the API know which data we would like to retrieve.
Next, we need to authenticate, and also let the API know which format we would like the data in. This is at the bottom of the form in the section titled:
HTTP request header parameters (optional)
We need to add one, as shown here called: adthena-api-key
Put that in the left box, and put your own API key in the right box. If you do not know your API key, contact your CSM our firstname.lastname@example.org and they will help you.
Now, click the add header button to add another header.
In the left box add: accept
as shown in the example, and in the right box, add: text/csv
We now have entered everything that we need, click OK and Power BI will start to retrieve the data.
Step 11: Our data is ready
Once the data is retrieved, Power BI will show us the data in a table. We can now if we choose, extract that data and apply any changes that we would like.
Here we are happy with the data we see, so we will click ok to proceed.
Step 12: Using the data
Once the data is loaded, you will see your URL representing the data you requested on the right in the data section.
You can load several sets of data into one session so that you can add many different types of API data, and data from other sources into one dashboard.
Next, we will learn how to create a doughnut chart with our market share data.
Step 13: Visualizing Market Share
Click the doughnut chart button circled in the image, and a greyed-out doughnut will appear on the dashboard.
Step 14: Completing our chart configuration
In this example, we are creating a top 10 competitor Market Share, share of clicks chart. To build this, we need to do three things:
1. Drag the competitor field from our data on to the ‘Legend’’ box
2. Drag the ‘ShareOfClicks’ field from our data on to the “Values” box
3. In the filters section, select ‘Competitor’, then from the ‘Show Items” section, select “Top”, then enter the number 10, and then click “Apply Filter”
That is it, we have our chart. Congratulations on creating your first Adthena visualisation in Power BI - you can now continue using the API, add more data, and build more charts!