ShopifyStorefront blocks

Setting up storefront blocks

Installing the FanBase blocks on a Shopify store, connecting them to your community, and turning on sign-in.

In build

FanBase features as blocks you add to a Shopify theme, in the theme editor, with no code. A customer browsing your store sees quests, their profile and their avatar on your own pages, under your own domain.

The blocks are rolling out store by store, starting with pilot communities. These pages describe the first release so your team can prepare. Ask your FanBase contact before you plan a launch around them.

What is in the first release

BlockShowsPage
QuestsYour community's quests, completed and claimed in the storeQuests
Profile cardThe customer's avatar, name, tier, rank, points and XP at a glanceProfile
ProfileThe full profile, with history and personalisationProfile
Account indicatorA small button for your header with the customer's picture, points and ranksAccount indicator
BalanceThe customer's points as compact chipsAccount indicator
AvatarThe customer's avatar, in 2D or 3DAvatar

Blocks for the leaderboard, the store, the battlepass, events and the newsfeed follow in later releases, along with linking social and game accounts from the storefront.

Before you start

Three things have to be true.

Your theme is an Online Store 2.0 theme. That is every current Shopify theme, Dawn included. It is what lets an app add blocks.

Customer accounts are on. In your Shopify admin, under Settings, then Customer accounts. The blocks show a customer their own progress, so there has to be a customer. Note whether you use new or classic accounts: it affects how accounts are matched.

Your store is connected to your community. This is the same connection that powers purchase rewards, done once in the Hub. The Shopify page of the Hub docs has the steps. Without it, the blocks cannot sign anyone in.

Install the blocks

The blocks come as a Shopify app. It is installed from a link made for your store, not from the Shopify App Store.

Send us your .myshopify.com domain

The original one, ending in .myshopify.com, not your custom domain. It is under Settings, then Domains.

It is unique to your store. The app asks for no permissions: it only adds blocks to the theme editor and reads nothing from your store.

Check it arrived

In Online Store, then Themes, press Customize. Open App embeds in the left sidebar. FanBase is listed there.

Connect it to your community

Everything shared between the blocks lives in one place: the FanBase app embed. Turn it on, then fill in three fields. Your FanBase contact gives you the values.

SettingWhat goes in it
TenantYour community's own site address
API URLThe FanBase API address for your community
Community slugYour community's short name

Every block reads these. A block can override them in its own advanced settings, which is only useful if one store shows more than one community.

Work on a copy of your live theme, then publish it when you are happy.

Turn on sign-in

One switch in the app embed: Let signed-in customers take part.

SwitchWhat customers get
OffRead-only. Quests can be read, nothing can be completed, and the account blocks show nothing.
OnA customer logged in to your store is signed in to FanBase automatically, and can complete quests and claim rewards.

There is no FanBase login screen. Being logged in to your store is the login. A visitor who is not logged in sees a prompt that sends them to your store's own login page and brings them back to the page they were on.

Leave Sign-in path empty unless your FanBase contact gives you a value.

Sign in with Shopify explains how a store customer is matched to a FanBase account.

Create the pages

Two pages cover the first release. Create them under Online Store, then Pages, and add them to your menu.

PageAdd this blockThen
A rewards or account pageProfile cardSet it as the Account page in the account indicator's settings
A quests pageQuestsSet its address as the Quests page URL in the app embed

To add a block: open the page's template in the theme editor, press Add block or Add section, choose Apps, and pick the block.

The app embed's Links group is where blocks find each other. Quests page URL is where "earn more" links go, so set it to your own quests page and customers stay in your store.

Put the indicator in your header

The account indicator is the piece customers see on every page. Most theme headers do not accept app blocks, so the app embed can place it for you. Account indicator has both ways.

Check it works

Use a test customer, in a normal window and a private one.

CheckYou should see
Logged out, quests pageQuests listed, each with a prompt to sign in
Logged out, account pageA prompt to sign in
Press sign inYour store's login, then back to the same page
Logged in, headerThe indicator with a picture or an initial, sitting with your header icons
Logged in, account pageThe avatar, name, tier, rank, points and XP bar
Complete a simple questA prompt to choose a username the first time, then the quest shows as completed and the points update in the header

If the indicator floats in a corner of the screen, its header setting does not match your theme. Account indicator has the fix.

When something is wrong

A customer never sees a broken box. A block that cannot load shows nothing to shoppers, or only its heading. The theme editor is where you find out why: open the page there and the block shows a short note.

Note in the theme editorFix
FanBase is not configuredTurn on the app embed and fill in Tenant, API URL and Community slug
The block needs sign-inTurn on Let signed-in customers take part
Sign-in is not working on this storeThe store is not connected to your community yet. Check the Hub.

Turning it off

In order of how much it undoes:

  1. Switch off Let signed-in customers take part. Every block goes read-only. Nothing is lost.
  2. Switch off the app embed and remove the blocks, or go back to your previous theme.
  3. Uninstall the app.

Fan accounts and everything they earned stay in FanBase in every case.

On this page