Import data to Matomo from external domain webhook


#1

Hi everybody,

I need to somehow track when users click on a website plugin’s button. The plugin is a popup window with two buttons, allow and cancel. It is a 3rd party plugin, they collect the data and show it using a nice dashboard and you can see who clicked on allow or cancel. I would like to collect that data into my Matomo server.
They offer the possibility of sending the data once it is triggered to your server using webhooks (and CORS). The way it should work is everytime somebody clicks on the ALLOW button, the 3rd party plugin sends the data to a URL on my Matomo server and my Matomo server collects it. Here you can see a screenshot of the options I have on the 3rd party website to send the data to my Matomo server.


I have been checking the FAQ and KB and I haven’t found anything like this.
Is that possible right now with the current version of Matomo?

I hope somebody can shed some light,
Thanks in advance,
Alex


(Lukas Winkler) #2

Hi,

You could try enteringthe URL of your Matomo tracking API.

https://developer.matomo.org/api-reference/tracking-api

But if the webhook get’s send by the server instead of the visitors browser, the tracked data won’t probably be that useful.

So something like

https://matomo.yoursite.example/piwik.php?action_name=Dein_Seitenname&idsite=12&rec=1&url=https://yoururl.example/

should work.


#3

Hi Lukas,

Thank you so much for your response.
Once I create the URL I need, do I have to configure a campaign on Matomo Server to receive the data?
It makes sense but I am not sure if Matomo is going to sort out the data and show it somehow or I have to set up a campaign. It is basically a click event what I want to track.

Thanks again,
Alex