I'm using Google Tag Manager to deliver Facebook Pixel.
Then, I fire events using code like this
<body>
...
<script>
fbq('track', 'ViewContent', {
content_type: 'product',
content_ids: ['1234'],
content_name: 'ABC Leather Sandal',
content_category: 'Shoes',
value: 0.50,
currency: 'USD'
});
</script>
</body>
But when the code is executed I got an error since Facebook Pixel is loaded asynchronously and fbq is not available yet.
Uncaught ReferenceError: fbq is not defined
What should I do?