Add scripts to header from string
Hi everyone
I want to add a few scripts to my header, but I want to receive these scripts from Sanity CMS, so I will receive it as string.
Any way to do it?
1 Reply
I need to do this for google tag manager and Facebook meta pixel
Any idea?
But for example, how to do it for this 2 codes:
That is what I didn't understand
I can receive a string or not, I'm trying to give the flexibility to do it
but I don't know how to do with the primitive
I'm seeing this example but I don't have sure how to adapt it for these two scripts
Yes I can
Sorry to bother you @Tito, but can you please help me trasnforming one of the scripts into an example using the primitive you share?
yes, I have a private repo on Github
but it's a simple solid start app using data from Sanity CMS
I'm adding the scripts manually instead on sanity to be easier
no, I'm only don't know how to put the scripts using the primitive and type for example the
window
That part I understand
This will be something like:
But whow you type the window to have the dataLayer
?
And how to do this one?
Solid start have html file?
Bu that isn't only for SSR?