Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
An example of a server-side GTM variable template that doesn't work ufortunately.
// A variable template that doesn't work, because it uses an asynchronous API.
const JSON = require('JSON');
const sendHttpRequest = require('sendHttpRequest');
sendHttpRequest('[enter_api_key_here]&units=metric&lang=nl', (statusCode, headers, response) => {
response = JSON.parse(response);
return response;
}, {method: 'GET', timeout: 2000});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment