What's the best way to add third-party scripts (GTM)? #126
Answered
by
ElMassimo
emmanuelsw
asked this question in
Q&A
-
Hello! <component :is="'script'">
<!-- GTM Script -->
</component> This feels a little bit hacky to me, also we couldn't find a way to add an element right after Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Answered by
ElMassimo
May 30, 2022
Replies: 1 comment
-
Hi Emmanuel! That's one way to do it, I don't see any disadvantages for an îles site. The "supported way" is to use Head scripts, as in this example: # src/app.ts
import { defineApp } from 'iles'
export default defineApp({
head: {
script: [
{ src: '<third party script url>', async: true, once: true },
],
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ElMassimo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Emmanuel!
That's one way to do it, I don't see any disadvantages for an îles site.
The "supported way" is to use Head scripts, as in this example: