Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Deep Link to header section not working, please help!

Solved

Deep Link to header section not working, please help!

da_bob
Shopify Partner
1 0 0

I am trying to use a deep link to an app extension / app embed so the user can just turn it on easily as part of the install flow but I can't get it to work. This is the deep link I've created:

https://{shop_url}/admin/themes/current/editor?addAppBlockId=7a2b8f57-8d03-47a9-8683-4222c639f0f8/blockname&target=sectionGroup:header

 This yields a response:

"blockname" not added. There is a problem with the app block. Contact the app developer.

 

In the blockname.liquid file I have:

<script src="{{ 'blockname.js' | asset_url }}" defer></script>

{% schema %}
{
"name": "AppName",
"settings": [],
"target": "head"
}
{% endschema %}

 

When I manually add the app embed, on the shop in question looking at the code I see:

 

 

<!-- BEGIN app block: shopify://apps/appname/blocks/blockname/7a2b8f57-8d03-47a9-8683-4222c639f0f8 -->
<script src="https://cdn.shopify.com/extensions/a8177303-19b6-4337-807d-5c29cd5a5b02/appname-1/assets/blockname.js" defer=""></script>
<!-- END app app block -->

 

 

and the app extension works fine.

 

Please help me create a valid deep link.

 

NB: I have changed the appname and blockname to create this post but the IDs I've left in tact

Accepted Solution (1)

SBD_
Shopify Staff
1831 273 423

This is an accepted solution.

Hey @da_bob 

 

To link to the app embed, try this:

 

/admin/themes/current/editor?context=apps&appEmbed=7a2b8f57-8d03-47a9-8683-4222c639f0f8%2Fchatbot

Scott | Developer Advocate @ Shopify 

View solution in original post

Replies 2 (2)

SBD_
Shopify Staff
1831 273 423

This is an accepted solution.

Hey @da_bob 

 

To link to the app embed, try this:

 

/admin/themes/current/editor?context=apps&appEmbed=7a2b8f57-8d03-47a9-8683-4222c639f0f8%2Fchatbot

Scott | Developer Advocate @ Shopify 

ThePilsen
Shopify Partner
10 0 0

 

Hi @da_bob,

I'm trying to create a deep link for my app embed so that users can easily activate it as part of the install flow. I saw your solution and have a similar issue. Here is the deep link I'm using:

 

This link opens up all available embed apps in the left sidebar, but I want my app (2nd one, SmartBot) to be pre-checked (activated already). I saw a competitor achieve this, but I can't figure out how.

dep1.png

 

 

 

 

In your response, you mentioned adding /chatbot at the end of the URL:

 

/admin/themes/current/editor?context=apps&appEmbed=7a2b8f57-8d03-47a9-8683-4222c639f0f8%2Fchatbot

 

How did you know to add /chatbot? Where did you get that from?

Here’s my directory structure if it helps:

 

./codeboar:
drwxr-xr-x 2 root root 4096 Jun 11 09:07 assets
drwxr-xr-x 2 root root 4096 Jun 11 12:36 blocks
drwxr-xr-x 2 root root 4096 Jun 11 09:27 locales
-rw-r--r-- 1 root root 285 Jun 11 12:27 shopify.extension.toml
drwxr-xr-x 2 root root 4096 Jun 11 12:35 snippets

./codeboar/assets:
./codeboar/blocks:
-rw-r--r-- 1 root root 588 Jun 11 12:36 chat.liquid

./codeboar/locales:
./codeboar/snippets:
-rw-r--r-- 1 root root 30 Jun 11 12:16 chat_snippet.liquid

 

Any guidance on how to form the URL correctly to pre-activate my app embed would be greatly appreciated!

Thanks!

Best regards,

Pilsen