I want to set a flow of information into Google Tag Manager for Server Side. They allow you to create post requests but I don’t really know how to configure them. Can anybody help with this?
Hi @solari , here are a couple of references that might help:
Let me know if that’s clear.
I´m through the same, I want to receive an HTTP POST request on Google Tag Manager for server-side, docs say “The container itself operates as an HTTP API endpoint, to which any browser, device, or other sources that support the HTTP protocol can send requests.”
So I set up a workflow with a final step making an HTTP POST request to Google Tag Manager for server-side. For that, in the “HTTP Request Configuration” I select POST and then I change the url provided default by the container´s URL for server-side, I don´t know if that´s well, but otherwise I cannot find a field which identifies the container for the server-side of GTM (API endpoint), since in my account I have several containers. (url default is https://www.googleapis.com/tagmanager/v2/accounts)
When I test the workflow it says " Error, Request failed with status code 400"
Can someone help me with this?
The HTTP 400 error means that the request data doesn’t match what the API endpoint expects. Can you please verify if the parameters and body data are configured correctly?
Hi @servicioalcliente , we actually just released some prebuilt actions that might help with the scaffolding for your POST request - please see the new Action “Create Tag” that might help!
You were right, I had to set the client (path) in Google Tag Manager to catch the HTTP request
I tried the way you say (with Google Tag Manager account, a container and a workspace, then the action to create a Tag) but an error message came up: SyntaxError
Unexpected token c in JSON at position 0
Can you confirm that you’ve filled out the name, type, and parameter per the specification as well?
Example:
I was filling out Name and Type but not Parameter, I filled it out as per your recommendation, and this is the outcome:
SyntaxError
Unexpected token , in JSON at position 315
Code
[
{
“key”: “html”,
“type”: “template”,
“value”: “”
},
{
“key”: “convertJsValuesToExpressions”,
“type”: “boolean”,
“value”: “true”
},
{
“key”: “usePostscribe”,
“type”: “boolean”,
“value”: “false”
}
],
“type”: “html”
}
]