Experience Config
8 min
the main configuration for any purple experience is done in a file called experience config json it is located in /storefront/assets within the dynamic content any data you put here is available to your app via the global data docid\ hh7yttoxelethdlpm 7dl object as it is part of dynamic resources, this configuration is generally also available in offline cases (note that a version of this file is bundled with the app thus, when downloading and app and accessing it in offline mode, upon first start, it might be outdated ) it is mainly used to configure features of pxp inside the purple element but the configuration you place in this file is generally ubiquitous, and available on any pxp page so it may also be used to configure custom keys on the top level that are necessary in a project all of the configuration keys in the purple object are optional and should only be set if a certain configuration is needed example config file this code snippet will need to be modified according to the needs of the project { "language" "en", "custom title" "hello world", "purple" { "analytics" { "ga4" { "configuration" { "measurementid" "provided by google analytics 4" }, "consent" { "vendorid" "customid matching the used cmp", "iabvendorid" "iab id" } } }, "consentmanagement" { "cmpprovider" "consentmanager", "cmps" { "consentmanager" { "configuration" { "codeid" "provided by consent manager", "cmphost" "provided by consent manager", "cmpcdn" "provided by consent manager", "cmpblockignoredomains" \[] } } } } } } available settings unless specified otherwise, all the following configuration happens inside the purple object preconnects see preconnects docid 1e8fgqizp9sc59mdxdij2 website locale for seo and accessibility reasons, we recommend that you set the locale for your website explicitly you can simply do this by adding, i e "language" "de" to the top level of experience config json this will then be added to your website's html as \<html lang="de"> please refer to https //www w3 org/international/articles/language tags/ https //www w3 org/international/articles/language tags/ for further information on locales in general tracking systems most third party tracking systems must be set up in both experience config in the analytics object and purple manager for details, see tracking and analytics docid\ cwokg2ejseayqbyzzk8bt and refer to the detailed steps for the individual trackers note that you must set up the tracking config as well, to map events from the purple system to the tracker this setup allows the changing of trackers with limited adjustments in your tracking logics cmp most consent management platforms must be set up in both experience config in the consentmanagement and purple manager for details, see consent management app & web docid\ iubzrguxkik85qjapwxie features configured inside the features object currently available keys spa controls whether to use single page application (spa) routing or to load the full page on every navigation when false , navigation actions (navigate, open content, open url) will trigger full page reloads when true or not set , uses spa routing (default behavior) lazyscrollrestoration controls whether to disable the lazy scroll restoration retry mechanism when true, the scroll restoration will not retry if the initial position is not reached when false or not set, uses the default retry behavior scripts using the scripts object, it is possible to add additional script tags to the head or body each script configuration provides a key value pair which then will be rendered as attributes of said script tags tags without value (e g async) should be configured with an empty string or null using booleans as values is not allowed and may result in unwanted behavior since the boolean will just be stringified example { "purple " { "scripts" { "head" \[ { "id" "123", "src" "https //example com/myheadscript js", "async" "" } ], "body" \[ { "id" "456", "src" "https //example com/mybodyscript js", "data setting" "abc" } ] } } } caches inside the caches key, it is possible to globally overwrite the default api cache duration using apimaxage in ms (default 60000, meaning one minute) apart from that, each data source can define its duration itself legacy flags the legacy object is a place, where we put feature flags of old features which we intented to sunset but still support for a limited time presenter the presenter config is a place where configuration for the web presenter lies which was previously set up in the purple manager these are configuration fields which are rarely used and should only be set when the default is not suitable contentfitstrategy the fallback content fit strategy when the content does not provide its own defaults to fitiside contentmaxwidth max width for the presenter in px purchasepreviewurl url to be redirected to in preview issues when navigating outside of the preview area of the issue downloadfilename format of the downloaded file name possible values and their format, defaults to publication issue publication issue > \<publication> \<issue>\[ \<page>] \<ext> issue > \<issue>\[ \<page>] \<ext> original > the attachment's own filename, unchanged