Expected behavior is the EventCollectorContextProvider has these fields in the context when applying mse.context.setStorefrontInstance(context).
Expected add-to-cart event storefront instance to include these fields but only saw baseCurrencyCode and storeViewCurrencyCode.
Actual Behaviour
It only has baseCurrencyCode and storeViewCurrencyCode in the context.
Reproduce Scenario (including but not limited to)
Implement EventCollectorContextProvider and try to send an add-to-cart event.
Check the snowplow schema and storefront instance will only have two fields in data when schema expects more listed above.
Fix for the issue
Created custom ExperiencePlatformConnector from the source code and added fields to the graphql query and when setting the storefront instance context.
Expected Behaviour
StorefrontInstanceContext requires the following fields in the snowplow schema for iglu:com.adobe.magento.entity/storefront-instance/jsonschema/3-0-1
"environmentId", "environment", "storeUrl", "websiteId", "storeId", "storeViewId", "websiteName", "storeName", "storeViewName", "baseCurrencyCode", "storeViewCurrencyCode"
Expected behavior is the EventCollectorContextProvider has these fields in the context when applying mse.context.setStorefrontInstance(context).
Expected add-to-cart event storefront instance to include these fields but only saw baseCurrencyCode and storeViewCurrencyCode.
Actual Behaviour
Reproduce Scenario (including but not limited to)
Fix for the issue
Changes made to graphql query
import { gql } from '@apollo/client'; export default gql` query DataServicesStorefrontInstanceContext { dataServicesStorefrontInstanceContext { catalog_extension_version environment environment_id store_code store_id store_name store_url store_view_code store_view_id store_view_name website_code website_id website_name } storeConfig { base_currency_code store_code } }
Changes made to Storefront Instance context
storeConfigQuery().then(({ data }) => { const { environment, environment_id, website_id, website_code, website_name, store_url, store_id, store_code, store_name, store_view_id, store_view_code, store_view_name, catalog_extension_version } = data.dataServicesStorefrontInstanceContext; const { base_currency_code } = data.storeConfig; const context = { environmentId: environment_id, environment, storeUrl: store_url, websiteId: website_id, websiteCode: website_code, storeId: store_id, storeCode: store_code, storeViewId: store_view_id, storeViewCode: store_view_code, websiteName: website_name, storeName: store_name, storeViewName: store_view_name, baseCurrencyCode: base_currency_code, storeViewCurrencyCode: base_currency_code, catalogExtensionVersion: catalog_extension_version };
}); `;