An example of a server-side GTM variable template that doesn't work ufortunately.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A variable template that doesn't work, because it uses an asynchronous API. | |
const JSON = require('JSON'); | |
const sendHttpRequest = require('sendHttpRequest'); | |
sendHttpRequest('https://api.openweathermap.org/data/2.5/weather?lat=52.3746027&lon=6.6810724&appid=[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