3 min read

Shopify technical SEO integration guide

This guide shows you how to add RankAI's technical SEO script to your Shopify store. The script runs in the background on your site and helps search engines understand your pages better. You don't need any coding experience. We'll open your theme code, add one block of code inside the <head> section, and save.

Where to get your code

In your RankAI project, go to Technical SEO & GEO and look for the Apply Changes button at the top right and Click it. Select Shopify as the provider. snippet of code that looks like the one below. Copy the whole thing. Your version will have your own project ID in it.

<script src="https://rankai.ai/apply.js" data-rankai-id="YOUR_PROJECT_ID" crossorigin="anonymous" defer></script>
Apply Changes buttonGet Code button
Technical SEO & GEO → Apply Changes → Shopify → Copy the code on the 5th step.

Keep that code handy. In the next steps we'll add it to your Shopify site so it loads on every page.

Step 1: Log in to your Shopify admin

Open your browser and go to your Shopify admin. Usually you type your store URL followed by /admin (for example mystore.myshopify.com/admin), or you can log in at shopify.com and open your store from there.

Enter the email and password you use for this store. After you log in, you'll see the main admin screen with a left sidebar. That's where you'll find Online Store, Settings, and other options.

Step 2: Go to Online Store > Themes

In the left sidebar, click Online Store. Then click Themes. You'll see a page that shows your current theme and any other themes you've added.

The theme that's live on your store is labeled as the current theme. We need to edit that theme's code in the next step.

Edit code button
Go to Themes.

Step 3: Open Edit code for your current theme

On the Themes page, find the Current theme section. Next to your current theme you'll see a row of buttons or a three dots menu (often labeled "Actions"). Click the three dots, then click Edit code.

The theme code editor will open. You'll see a list of files on the left (Layout, Templates, Sections, and so on). We need the file called theme.liquid in the next step.

Edit code button

Step 4: Find the theme.liquid file

In the left panel of the code editor, look under Layout. Click theme.liquid. This file controls the main layout of every page on your store, including the <head> section where we'll add the script.

The file will open in the main area. You'll see HTML and Liquid code. Look for the <head> tag. It's usually near the top. The RankAI script must go inside the <head> section, before the closing </head>.

Theme.liquid file

Step 5: Add the script inside the <head> tag

Click inside the code so your cursor is somewhere between <head> and </head>. Paste the code you copied from RankAI on a new line. You can use right-click then Paste, or the keyboard shortcut (Ctrl+V on Windows, Cmd+V on Mac).

Make sure you paste the entire line, from <script to </script>. Don't change or remove any part of it. If there's already other code in the <head> (for example tracking or meta tags), paste the RankAI script on its own line above or below.

Paste script

Step 6: Save your changes

Click Save in the top-right corner of the code editor. Wait until you see a message that the changes were saved. The script is now part of your theme and will load on every page of your store.

That's it. RankAI will use the script to apply the technical SEO settings you've chosen in your project. You don't need to do anything else in Shopify.

Save changes

Step 7: Verify the script is installed correctly

Now go to RankAI tab again and click Check Script Connection. If you see a text in green saying Script detected on your site, the script is connected correctly.

View page source

Quick checklist

  • Logged in to your Shopify admin
  • Went to Online Store > Themes
  • Clicked three dots on the current theme > Edit code
  • Opened the theme.liquid file under Layout
  • Pasted the full script inside the <head> tag
  • Clicked Save
  • Checked script connection in RankAI (Check Script Connection)

FAQ

Why do I add the script in theme.liquid and not somewhere else?

theme.liquid is the main layout file that wraps every page on your store. Code in the <head> section of theme.liquid loads on all pages, which is what we want for the RankAI script. Other files (like a single template or section) might only affect one page type.

What if I switch to a different theme later?

The script is part of the theme you edited. If you switch to another theme, you'll need to add the script to that theme's theme.liquid file as well, using the same steps.

How do I know if it's working?

After saving, open your live store in a new tab (the public site, not the admin). You can use your browser's "View page source" option (usually right-click then View Page Source) and search for "rankai" or "apply.js". If you see the script in the source code, it's loaded correctly.

Where can I get more support?

Contact your RankAI account team or check the help section in your dashboard.

Back to Shopify integration