Matomo server-side

I’ve tested the new Advanced Server-Side template for Matomo in Google Tag Manager (GTM). While the tag does fire in GTM preview, it fails and returns a status code of 302.

Can you please share a screenshot of your tag settings?

Do your tracking URL look like this?

https://matomo.example.com/matomo.php

I’m using Matomo cloud, so my tracking URL looks like this:

mydomain.matomo.cloud/

But I’ve also tested with these:
mydomain.matomo.cloud/index.php
mydomain.matomo.cloud/matomo.php

Could it be an issue with Matomo Cloud vs Matomo on-premise?

The correct format is https://mydomain.matomo.cloud/matomo.php

What status code do you receive in response when you use this URL?

After I updated URL to https://mydomain.matomo.cloud/matomo.php, the Status code is 400.

Status code 400 means that something incorrect in the data you send.
To debug this, you can enable Debugging mode on your Matomo instance.
https://developer.matomo.org/api-reference/tracking-api#debugging-the-tracker

The issue was caused by the fact that the user who created the auth_token only had view permissions. The problem was resolved when the user was upgraded to have write permissions.