Schema App Connector for AEM Overview

Modified on Wed, 22 Mar 2023 at 02:36 PM

Introduction


Adobe Experience Manager (AEM) is a comprehensive content management solution for building websites, mobile apps and forms.


The Schema App Connector for AEM was created to serve a growing subset of our clients who host their websites on AEM. The connector allows our clients to get JSON-LD server side which increases schema markup deliverability as well as reduces client page rendering time. With this method, clients are able to deploy up-to-date schema markup to their websites at scale.


TABLE OF CONTENTS


Technical Design

The Schema App connector for AEM locally caches your Schema Markup so it can be deployed with the rest of your content when the page is rendered. This provides greater assurance your schema markup will load in time for Search engines. 


The Integration

The first step in the process is integrating with AEM using one of the following methods:


If you chose to use a JavaScript option, AEM will inject highlight.js into your pages when add the configuration to your site. If you chose the Crawler option, once the configuration is added to your pages you can start a crawl to begin deployment.


                             [Fig. 1] Initial Setup Flow



  1. After plugin installation, the AEM Author logs into  AEM and creates a new configuration and adds the details that they have copied from Schema App.


  1. Submit the details to Schema App to Register the AEM URL.


  1. Schema App will return a Success response if the Account details and URL are correct. 


  1. The AEM Author will add the newly created configuration to the respective sites in which they want to enable the plugin.


  1. Publish the AEM page, where we have configured the plugin.


The Schema App AEM Connector is now ready to receive Schema Markup webhooks.



JSON-LD Injection

Once the registration is all set up, the process of inserting and updating JSON-LD can proceed. 



[Fig. 2] JSON-LD Injection Flow

  1.  AEM Scheduler runs on a predetermined schedule to make calls to the Schema App API data for each page. This scheduler runs on both the Author and Publisher instance so any data updates on the Author are replicated with the markup.

  2.  Once a response is received from the DATA API call, if it's not blank we will find that page in AEM, and create a 'schemaapp' node under the page node and set the JSON-LD. If a node already exists then the JSON-LD is stored and updated.

  3. After updating JSON-LD in the page node, we will make a call to the AEM dispatcher to clear the cache for that particular page. This request is sent from the Publisher instance as shown above. 

  4. Once a user visits the website URL (e.g. page1), a request first comes to the Dispatcher as we have already cleared the cache for page1, and redirects to the Publisher. In the Publisher, there is a JSP script (headlibs.jsp) that will conditionally insert the JSON-LD Schema Markup into the head tag of the page if the Schema App node exists under the page node. This leverages the apache sling framework that AEM is based on. This JSP is invoked only after setting up the Schema App configuration in Author instance upon plugin installation. Additionally, this injection only occurs for non-headless installations. 


NOTE: When a new page is published from the Author, JSON-LD is not removed. This is because the Scheduler runs on both Publisher and Author and therefore the JCR, when replicated to the Publisher, will include the markup.


Headless AEM

For decoupled AEM, when a user requests a page, the request will be served by the front end (React JS or Angular JS), AEM frontend will call the page.model.json API and fetch the page content as JSON.


When the response is received from the API, scripts are created and added to the HTML header section. Subsequent API calls to the JSON API generate and insert required Schema Markup on the page.


Sample script.



Cache Invalidation


In general, it will not be necessary to invalidate the dispatcher cache. Schema App does send a request when the markup is updated. 

Permissions & Services 

The below table highlights the permissions and services that will be required for the plugin to work efficiently.     

 

Path

Read

Modify

Create

Notes

/content*

To create schemaapp JSON-LD data node under page content node.

/etc/cloudservices* 

  To create and read schemaapp config

    

 

Function

Role

Author

API registration.

Publisher

Receives requests from the dispatcher.

Scheduler

Makes calls to the Schema App CDN.



User Permissions: Content-author access is required to create new Cloud configurations. No other special access is required.


Security Features

  • Source of JSON-LD is validated by Schema App connector to make sure that malicious scripts or JSON-LD can not be injected into a website.

  • Schema App optimizes content visible on the web, primarily public data. Script is not able to change website content  Schema App Privacy Policy.

  • Validation of metadata and content of JSON-LD


Installation Guides


Additional Resources

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article