Install HalalSpark on Shopify
Shopify does not use plugins for this type of installation. Scripts are added directly through your theme's code editor or the visual customiser.
Your website must be approved before ads can serve. If you have not added your site yet:
- Go to your HalalSpark dashboard
- Click Add Website
- Submit for review
Approval usually takes up to 24 hours. You will be notified when complete.
Auto Ads
Add one script to your Shopify theme.
HalalSpark handles placement automatically.
You only need to add this script once to your theme. Shopify's theme.liquid file loads on every page of your store — so a single script covers your entire site.
Control ad types, density, and page rules from your dashboard.
Get your Auto Ads script
- Go to your HalalSpark Publisher Dashboard
- Click your website
- Open the Set Up Ads tab
- Select Auto Ads and complete the setup steps
- Copy your script from the final screen
If setup is already complete:
- Go to your website → Placements tab
- Click Copy Script next to your Auto Ads configuration
<script src="https://ads.halalspark.co.uk/get-auto-ads-script?websiteId=YOUR_WEBSITE_ID" async></script>YOUR_WEBSITE_ID is unique to your site. Copy the script exactly as shown. Do not edit it.Open your theme's code editor
In your Shopify Admin:
- Go to Online Store → Themes
- Find the theme marked Current theme — this is your live theme
- Click ⋯ → Edit code
live theme — the one marked Current theme. Editing a draft or unpublished theme will have no effect on your store.Open theme.liquid and paste the script
In the file list on the left, open Layout → theme.liquid.
Find the closing </head> tag. Paste your script directly before it.
<head>
{{ content_for_header }}
<script src="https://ads.halalspark.co.uk/get-auto-ads-script?websiteId=YOUR_WEBSITE_ID" async></script>
</head>async attribute. Without it, the script can block your page from loading.Save the file
Click Save in the top-right corner of the code editor.
Check your installation
- Open your store in a new tab
- Ads should appear within a few seconds
- If nothing appears, add
?test=1to your URL to preview, or see troubleshooting below
Adjust settings any time
You can change your settings at any time from the Placements tab in your dashboard:
- Ad density — number of ads per page
- Ad types — inline, banner, header, footer, sidebar
- Page rules — include or exclude specific URLs
Changes apply immediately. No code updates required.
theme.liquid. Theme updates can overwrite your changes.&profile=NAME) that you paste into the relevant Shopify template file. Set them up in your dashboard under Set Up Ads → Auto Ads → Add Profile. Full details in the Auto Ads guide.- Preview mode
- Add
?test=1to your page URL. Ads show with a TEST label. No impressions are recorded. - Debug mode
- Add
?debug=trueto your page URL. Open your browser console to view logs and placement decisions.
Manual Ads
Place ads exactly where you want them.
Each placement has its own script from your dashboard. Add it to your theme where the ad should appear.
Path A — Custom Liquid block
For Shopify 2.0 themes. No code editing required. Use the visual customiser to place ads on specific pages.
Get your placement script
- Go to your HalalSpark Publisher Dashboard
- Click your website
- Open the Set Up Ads tab
- Select Manual Ads, choose an ad type, and complete the setup
- Copy your script from the final screen
If the placement already exists:
- Go to your website → Placements tab
- Click Copy next to the placement you want to install
<script src="https://ads.halalspark.co.uk/get-ad-script-banner?placement_id=YOUR_PLACEMENT_ID&domain=yourdomain.com&_v=3.0" async></script>domain= value must match your registered domain exactly.example.com and www.example.com are treated as different values. A mismatch will prevent ads from serving.Open the theme customiser
In your Shopify Admin:
- Go to Online Store → Themes
- Click Customize on your live theme
- Use the dropdown at the top to select the page type where the ad should appear
Add a Custom Liquid block
In the left panel, find the section where you want the ad. Click Add block and select Custom Liquid.
If you do not see a Custom Liquid option, your theme may not support it. Use Path B instead.
Paste your script and save
Paste your placement script into the Custom Liquid block. Click Save in the top-right corner.
The ad will appear at the position of the block on that page type. This applies to all pages of that type — for example, all product pages or all blog posts.
Path B — Theme file editing
For any Shopify theme. Requires editing Liquid template files directly. Use this if your theme does not support Custom Liquid blocks.
Advanced method
Editing theme files directly is harder to undo. If you are not comfortable editing code, consider using a Custom Liquid block (Path A) or contacting your theme developer.
Get your placement script
- Go to your HalalSpark Publisher Dashboard
- Click your website
- Open the Set Up Ads tab
- Select Manual Ads, choose an ad type, and complete the setup
- Copy your script from the final screen
If the placement already exists:
- Go to your website → Placements tab
- Click Copy next to the placement you want to install
<script src="https://ads.halalspark.co.uk/get-ad-script-banner?placement_id=YOUR_PLACEMENT_ID&domain=yourdomain.com&_v=3.0" async></script>domain= value must match your registered domain exactly.example.com and www.example.com are treated as different values. A mismatch will prevent ads from serving.Identify the right template file
The file to edit depends on where you want the ad to appear:
| Page type | Common file location |
|---|---|
| Blog post | sections/main-article.liquid |
| Product page | sections/main-product.liquid |
| Collection page | sections/main-collection.liquid |
| Regular page | sections/main-page.liquid |
| Homepage | templates/index.liquid or sections/ |
sections/ folder for a file whose name matches the page type you want.Open the file and paste your script
In your Shopify Admin:
- Go to Online Store → Themes → ⋯ → Edit code
- Open the relevant file from the file list
- Find the position in the template where the ad should appear
- Paste your script at that position
{% style %} or {% schema %} blocks. It must be in the main template body.Save the file
Click Save. Open the page on your live store to confirm the ad renders correctly.
- Preview mode
- Add
&test=1to the script URL. The ad renders with a TEST label. No impression is recorded. - Debug mode
- Add
&debug=1to the script URL. Open your browser console to see the targeting decision for that placement.
Ads not showing?
Work through this checklist before raising a support request.
Script placement
- Auto Ads script is inside
theme.liquid, before</head> - Manual Ads scripts are inside your template file in the body, at the exact position where the ad should appear
- The
asyncattribute is present on the script tag - The script URL uses
ads.halalspark.co.uk
Theme & saving
- You edited the
Current theme— not a draft or unpublished theme - You clicked
Saveafter editing — Shopify does not auto-save - If you recently updated your theme, check that the script is still in
theme.liquid— theme updates can overwrite changes
Domain & approval
- Your website is approved in your HalalSpark dashboard — the Set Up Ads tab only unlocks after approval
- The
domain=value in your manual placement script matches your registered domain exactly
Custom Liquid blocks
- Custom Liquid blocks are only available in Shopify 2.0 themes — if the option is not visible, use Path B (theme file editing)
- The Custom Liquid block is on the correct page type in the customiser
Browser & extensions
- Disable ad blockers and privacy extensions, then reload
- Test in a private browsing window with all extensions off
Debug tools
- Auto Ads: add
?debug=trueto your page URL → open browser console - Manual Ads: add
&debug=1to the script URL → open browser console - DevTools → Network tab → filter for
halalsparkto check requests and responses