Manage Matomo tag manager using Tagmanger APIs

Hi Everyone? I am creating container, tags and triggers in Matomo tag-manager section using tag-manager APIs. TagManager.addContainerTrigger giving following error.

"Conditions: "Conditions" has to be an array."

Here is the API.


Here is the screenshot of manually created trigger for 50% page scroll.

Please help me to create trigger. Thanks!

I am not expert on that… But for me, in HTTP, if you want to create an array, you should do: ...&arr=something&arr=somethingelse&arr=moredatainarray&...


The UI is using exactly this API. So just check your browsers developer tool when you click save and you will see the exact request and can modify it to your needs.

Keep in mind that the conditions are sent as form data.

Hi @Lukas and @heurteph-ei Thanks for help. It is working fine now. Able to create triggers through API but unable to set it values i.e., in case of ScrollReach I am unable to set value 25 for vertical-percentage. Please have a look at attached screenshot.

Here is my API.


Here is the screenshot of output.

On my side I have a POST with parameters in the form data (not in the URL):

parameters[scrollType]	"verticalpercentage"
parameters[pixels]	"1"
parameters[percentage]	"25"
token_auth	"anonymous"
force_api_session	"1"


Also (I don’t know if this has an impact or not), maybe check the idContainerVersion (=83) is the good one…

1 Like

Thanks @heurteph-ei I will try it with post method. may be it will work using Post method instead of get method.

Also both Firefox and Chrome allow you to copy a request as a curl command, which might help with reproducing the request.