Adding scripts above </header> and </body>

Google Adwords want me to put two scripts above the /header and /body code. Is this possible in Sparkle. I have added the scripts using TextEdit, but that would mean adding them to every page manually when the site is changed.

Having done a search I saw that adding text to the header was mentioned in 2019 but I haven’t been able to see a result answering this specific question.

While I am here, may I also ask if it is possible to embed code for Google Analytics in Sparkle.

Thanks again for any help.

Mike

Firstly @MikeHutch you can embed code into Sparkle by using Sparkle’s Embed widget which you can find under the “+” icon in the top of your Sparkle’s UI, or you can use the Sparkle navigation Insert / Embed.

Is Google Adwords the same as Google Adsense?
if they are you can find the input container for your code under Settings / Google Adsense.

Sparkle has a seperate Developer package that you can require with a one off purchase. I did that thinking I would need it as you can place code above the <header>, in the <header>, but I didn’t need it in the end because I used the Sparkle setting for Google Tag Manager under Google Analytics in Settings.

But I’ll leave it at that. I’m sure @duncan can help you out further with your inquiry.

Hi @MikeHutch, Sparkle has built-in support for Google Analytics:

https://sparkleapp.com/docs/setup.html#googleanalytics

For Adwords identification you’ll need to buy the Developer Tools option from the in-app “Your License” window, to add the ability to inject code in the page head.

Thank you for your help again FlaminFig. It is much appreciated.

Google Adsense is used when advertisements are shown on websites. Google Ads are paid for ads to get a site to the top of the Google search listings.

Regards.

Mike

1 Like

Duncan,

I am grateful for your help. I’ve had a look at the price for Developer Tools and have to say GBP89.00 is much more than I can justify paying. I guess I’ll have to put scripts in the header by using TextEdit. I’ll try to embed scripts into the body and hope that it works.

I’d like to take this opportunity to say thank you to you and your colleagues for continuing to develop Sparkle.

Regards.

Mike

Hey Mike Hutch,

You can try to put the entire code (with the header) in the embed, and place this embed at the very top of the pages so that it is at the top of the source code. I don’t know if this technically works every time, but it worked for me by integrating the tawk.to API for example.

I hope I was able to help you :slight_smile:

(Sorry for my English, I translate with ChatGPT)

Allan,

My apologies for the delay in responding to your suggestion.

You suggestion seems very practical. As it’s worked for you I think it’s worth trying.

Thank you for both your idea and for translating into English.

Regards.

Mike

1 Like