Problem regarding theme app extension deep link

I want to add a deep link to activate an app embed extension but I keep getting an error:
"age_popup" not added. There is a problem with the app block. Contact the app developer.

Here is the link that I used and have double-checked that the uuid is correct, the handle and section I tried different combinations as well but it didn’t work:
https://${shopDomain}/admin/themes/current/editor?template=index&addAppBlockId=${extensionId}/${blockHandle}&target=mainSection

Could you please confirm if the index.json template contains the main section? Alternatively, please share a screenshot of the sections in the index.json file.

Here is my index.json file

{
  "sections": {
    "image_banner": {
      "type": "image-banner",
      "blocks": {
        "heading": {
          "type": "heading",
          "settings": {
            "heading": "Browse our latest products",
            "heading_size": "h0"
          }
        },
        "button": {
          "type": "buttons",
          "settings": {
            "button_label_1": "Shop all",
            "button_link_1": "shopify://collections/all",
            "button_style_secondary_1": true,
            "button_label_2": "",
            "button_link_2": "",
            "button_style_secondary_2": false
          }
        }
      },
      "block_order": [
        "heading",
        "button"
      ],
      "settings": {
        "image_overlay_opacity": 40,
        "image_height": "large",
        "desktop_content_position": "bottom-center",
        "show_text_box": false,
        "image_behavior": "none",
        "desktop_content_alignment": "center",
        "color_scheme": "scheme-3",
        "mobile_content_alignment": "center",
        "stack_images_on_mobile": false,
        "show_text_below": false
      }
    },
    "featured_collection": {
      "type": "featured-collection",
      "settings": {
        "title": "Featured products",
        "heading_size": "h2",
        "description": "",
        "show_description": false,
        "description_style": "body",
        "collection": "all",
        "products_to_show": 8,
        "columns_desktop": 4,
        "color_scheme": "scheme-1",
        "full_width": false,
        "show_view_all": true,
        "view_all_style": "solid",
        "enable_desktop_slider": false,
        "swipe_on_mobile": false,
        "image_ratio": "adapt",
        "image_shape": "default",
        "show_secondary_image": true,
        "show_vendor": false,
        "show_rating": false,
        "quick_add": "none",
        "columns_mobile": "2",
        "padding_top": 44,
        "padding_bottom": 36
      }
    }
  },
  "order": [
    "image_banner",
    "featured_collection"
  ]
}

This could vary for every user depending on their theme and customization, is there a way to generalize it?

In which section would you like to add the app block extension?

The app is actually a popup which is basically a layover which shows up in the middle. It can be available on any and every page the user sets. I just want the deep link to take the user to the app embeds section of the theme editor and toggle it on. Can you let me know how to do that and what changes need to be made to my current url?

Can you confirm the details below?

addAppBlockId: Retrieve the SHOPIFY_{YOUR_EXTENSION_NAME}_ID value from your project’s .env file. This ID is used to uniquely identify the app block within your Shopify app project.

blockHandle: The {blockHandle} corresponds to the name of the Liquid file without the .liquid extension. For example, if the file is located at theme-app-extension/blocks/app-block.liquid, the {blockHandle} would indeed be app-block.

Example link I have tried: https://example.myshopify.com/admin/themes/current/editor?template=index&addAppBlockId=4ab97bc7-f3ae-7632-g108-a9d5924001b4/star_rating&target=mainSection

Yes in the .env file and the link the extension id is the same. I even checked in the settings.json file that the extension id corresponds to the one I am using as visible in the browser url field. The block id is also correct. This is what’s confusing me, I tried without specifying the template section and yet it doesn’t work.

Could you please share the link?

Could you please use and try the actual values instead of variables in the link?

https://${shopDomain}/admin/themes/current/editor?template=index&addAppBlockId=${extensionId}/${blockHandle}&target=mainSection

Here’s the link in the code:
https://${shopDomain}/admin/themes/current/editor?template=index&addAppBlockId=${extensionId}/${blockHandle}&target=mainSection

Do you want me to give you the generated url?

Did you try using actual values instead of variables in the link?

Could you please share the script screenshot?

@AMaL Hi, I too face the same issue. I want to inject the app block extension into my cart.json file.

{
  "sections": {
    "cart-items": {
      "type": "main-cart-items",
      "settings": {
        "color_scheme": "scheme-1",
        "padding_top": 36,
        "padding_bottom": 36
      }
    },
    "cart-footer": {
      "type": "main-cart-footer",
      "blocks": {
        "subtotal": {
          "type": "subtotal",
          "settings": {}
        },
        "buttons": {
          "type": "buttons",
          "settings": {}
        }
      },
      "block_order": [
        "subtotal",
        "buttons"
      ],
      "settings": {
        "color_scheme": "scheme-1",
        "padding_top": 20,
        "padding_bottom": 40
      }
    }
  },
  "order": [
    "cart-items",
    "cart-footer"
  ]
}

I want the app block to injected above buttons in cart-footer section.

Below is the link which I’m using:

https://${shopDomain}/admin/themes/current/editor?template=cart&addAppBlockId=${APP_ID}/widget&target=mainSection&position=before&blockOrder=subtotal,toolitup_shipping_upsell_bar_widget_dURNie,buttons

Am I doing it correctly or is there any change to be done?

Could you please try the link:

https://${shopDomain}/admin/themes/current/editor?template=cart&addAppBlockId=${APP_ID}/widget&target=sectionId:cart-footer