Skip to content

add analytics configuration details to documentation #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

sirugh
Copy link
Contributor

@sirugh sirugh commented Jun 12, 2025

Purpose of this pull request

This pull request (PR) adds reference details for configuring analytics properties in the config.json file.

Associated JIRA ticket

USF-2416

Staging preview

not staged

Affected pages

https://experienceleague.adobe.com/developer/commerce/storefront/setup/configuration/commerce-configuration/

Links to source code

hlxsites/aem-boilerplate-commerce#523

Signed-off-by: Stephen Rugh <rugh@adobe.com>
Co-authored-by: Carlos A. Cabrera <316104+fnhipster@users.noreply.github.com>
@jeff-matthews jeff-matthews added the documentation Improvements or additions to documentation label Jun 12, 2025
@jeff-matthews jeff-matthews self-assigned this Jun 12, 2025
Copy link
Contributor

@jeff-matthews jeff-matthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These may be noob questions, but I wasn't clear on how some of the linked docs relate to the analytics config props.

For type definitions of the analytics configuration properties, see the [storefrontInstance.ts](https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/types/schemas/storefrontInstance.ts) file in the commerce-events repository.

<Callouts>
1. **analytics.base-currency-code:** The base currency code for the store. See [Currency Setup](https://experienceleague.adobe.com/en/docs/commerce-admin/stores-sales/site-store/currency/currency-setup) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - we should fix these broken links. Cursor tried it's best :P


1. **analytics.environment:** The environment type (e.g., "Production", "Testing"). See [Cloud Environment overview](https://experienceleague.adobe.com/en/docs/commerce-cloud-service/user-guide/project/overview#environment-overview) for details.

1. **analytics.environment-id:** The unique identifier for your Commerce Cloud environment. See [Cloud Environment overview](https://experienceleague.adobe.com/en/docs/commerce-cloud-service/user-guide/project/overview#environment-overview) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think so.

<Callouts>
1. **analytics.base-currency-code:** The base currency code for the store. See [Currency Setup](https://experienceleague.adobe.com/en/docs/commerce-admin/stores-sales/site-store/currency/currency-setup) for details.

1. **analytics.environment:** The environment type (e.g., "Production", "Testing"). See [Cloud Environment overview](https://experienceleague.adobe.com/en/docs/commerce-cloud-service/user-guide/project/overview#environment-overview) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shiftedreality maybe you know the difference here between Production and Testing value being provided to this arg.


1. **analytics.store-name:** The display name of your store. See [Step 3: Create stores](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-admin#step-3-create-stores) for details.

1. **analytics.store-url:** The base URL for your store. See [Store URLs](https://experienceleague.adobe.com/en/docs/commerce-admin/stores-sales/site-store/store-urls) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ACCS? The link goes to a page that has a PaaS only badge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I thought that maybe we should remove all the links here. We are allowing users a way to dynamically define values used in storefront instance context. That context, hopefully, has documentation about what should be set in a frontend for headless commerce.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably replace links to the Admin Guides with a link to GraphQL query (or queries if we need a different one for ACO).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right - it's crazy to make someone have to make this themselves. Best thing we could do is automate it for them.


1. **analytics.store-code:** The code that identifies your store. See [Step 3: Create stores](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-admin#step-3-create-stores) for details.

1. **analytics.store-id:** The unique identifier for your store. See [Step 3: Create stores](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-admin#step-3-create-stores) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the linked page, I only see info about web site, name, code, and root category. Which one does analytics.store-id map to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. It's in the schema. Not sure what it's meant to be :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a chance to dig into the questions around where to find the *-id values for the store, store view and web site entities. Shout out to Russell Albin for clarifying.

These IDs aren't exposed in the Admin UI the same way that other properties are, for example code and name. Apparently, the easiest way to find the ID is to click through an entity in the Admin UI and look at the URL.

Alternatively, you can find the value in the app/etc/config.php file or by running a DB query. However, those alternative methods are not available for ACCS customers.

@sirugh, I saw your internal Slack message this morning asking if we really need the IDs or if we can just rely on code. I think it would be best to get that clarification before proceeding with this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we don't make non-technical users even aware of any of this :D

Partially why I made the tool to automate config generation (as best it could).

The real question we need to resolve is what exact information is necessary to send in analytics, and how do we (or a merchant) get that info?


1. **analytics.store-view-code:** The code that identifies your store view. See [Step 4: Create store views](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-admin#step-4-create-store-views) for details.

1. **analytics.store-view-id:** The unique identifier for your store view. See [Step 4: Create store views](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-admin#step-4-create-store-views) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the linked page, I only see info about store, name, code, and status. Which one does analytics.store-view-id map to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. It's in the schema. Not sure what it's meant to be :)


1. **analytics.website-code:** The code that identifies your website. See [Step 2: Create websites](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-admin#step-2-create-websites) for details.

1. **analytics.website-id:** The unique identifier for your website. See [Step 2: Create websites](https://experienceleague.adobe.com/en/docs/commerce-operations/configuration-guide/multi-sites/ms-admin#step-2-create-websites) for details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the linked page, I only see info about name, code, and sort order. Which one does analytics.website-id map to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. It's in the schema. Not sure what it's meant to be :)

"base-currency-code": "USD",
"environment": "Production",
"store-id": 1,
"base-currency-code": "{{YOUR_BASE_CURRENCY_CODE}}",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think we should maybe rethink how the data is displayed. I don't like all these placeholders, it feels repetitive. Perhaps we provide an example, then describe them in detail below.

We also have an opportunity here to make a tool that takes an API url, makes a query for these values, and returns the config object exactly as should be saved in config.json, or uploaded to public config.

Copy link
Contributor Author

@sirugh sirugh Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this? Ignore the keys/values in the screenshot - just a quick poc.

https://da.live/app/adobe-commerce/storefront-tools/tools/config-generator/config-generator

IMG_2784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants