How can I embed Viral Loops app code on my Dawn homepage?

Topic summary

A user wants to embed Viral Loops app code on their Dawn theme homepage but is struggling with placement. The app developers indicated Shopify doesn’t support easy custom script installation on the homepage and requires editing Liquid code directly, which they cannot support.

Context:

  • Building a pre-launch page that will occupy the entire homepage (logo at top, footer at bottom)
  • Successfully added the code to a new page following instructions
  • Working with a fresh copy of Dawn theme
  • Needs to add three components: Campaign JavaScript, Milestone Widget HTML, and Form HTML

Resolution:

  • The original poster resolved the issue by locating the correct placement within the theme.liquid file
  • A follow-up question asks for the specific location where the code was placed in theme.liquid, but remains unanswered
Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

Hi all. I would like to embed the code provided by the Viral Loops app on my Dawn homepage. I’ve followed their instructions and successfully (easily) added it to a new page, but I can’t figure out how to add it to the homepage.

Here’s the response from the app developers:

I searched a little bit more about the Shopify home page installation and it seems that Shopify doesn’t allow for an easy installation of a custom script. You will have to go to the edit theme option of your store and then write code in liquide.info. I am afraid this is something we cannot support.

I am comfortable adding it to the liquid code if someone is able to provide some direction. I’ve tried placing it in a few places but it’s been unsuccessful.

I’m good with these elements just being stacked. Here’s the code they’ve provided…

Campaign JavaScript

Start by adding the campaign javascript snippet in your website. You need this in the landing page of your website (where referral links will direct people) and also in every page where you will add the widgets for this campaign.

In the HTML of the page, add the following snippet of code right before the closing </body> tag:

Form html:

To add the Form Widget in your page, add the following HTML where you want it to appear:

Milestone widget html:

It has two forms: expanded and compressed.

You just need to install it once and it will adapt to fit in the page around it. This is useful for showing the widget in smaller screens or just adding in it in a small part of your page, eg. in a sidebar.

To add the Milestone Widget in your page, add the following HTML where you want it to appear:

I’m working on a fresh copy of Dawn with no modifications. Any direction you can provide on which files to place this in and where would be much appreciated! For context, I’m building a pre-launch page and this is going to take up the entire homepage (plus a logo at the top and a footer).

Thanks in advance!

I figured it out, just had to find the right place within theme.liquid.

Hey, where exactly did you paste the code within theme.liquid?