Connect a local development environment to ODP
Connect your local Optimizely Configured Commerce environment to Optimizely Data Platform (ODP) to test custom integration work before deployment. For example, verify code that you write for Send custom properties to ODP against a real ODP instance.
To connect your environment, complete the following tasks:
- Get the setting values from the ODP dashboard.
- Add the settings to your local configuration.
- Configure the Admin Console.
- Verify the setup.
Note These steps apply to local development only. Optimizely manages these settings for Sandbox and Production environments. Contact Optimizely Support to enable the integration on a hosted environment.
Prerequisites
Before you start, confirm that you have the following:
- ODP instance – An ODP instance in the same organization as Configured Commerce, with B2B modules enabled.
- Configured Commerce release – December 2024 Long-Term Support (LTS), December 2024 Short-Term Support (STS) 5.2.2412.1583+sts, January 2025 STS, or later.
- ODP dashboard access – Access to the ODP dashboard for your instance.
- Admin Console access – Administrator access to the Admin Console on your local Configured Commerce site.
Get the setting values from the ODP dashboard
Collect the API keys, Amazon Web Services (AWS) credentials, and JavaScript tag URL prefix from the ODP dashboard. You add these values to your local configuration in the next section.
Get the API keys
The public and private API keys let Configured Commerce send data to your ODP instance.
- In the ODP dashboard, go to Settings > APIs.
- On the Public tab, copy the key for the SearchService__ODP__PublicApiKey setting.
- On the Private tab, copy the key for the SearchService__ODP__PrivateApiKey setting.
Get the AWS credentials
The AWS credentials let integration jobs upload export files to the Amazon S3 buckets that ODP imports from.
- Go to Data Setup > Integrations.
- Click AWS.
- In the Amazon S3 panel, copy the following values:
- Data Imports – The bucket for the SearchService__ODP__S3ImportBucketName setting.
- Data Exports – The bucket for the SearchService__ODP__S3ExportBucketName setting.
- Key ID – The access key for the SearchService__ODP__S3AccessKey setting.
- Secret Access Key – The secret key for the SearchService__ODP__S3SecretKey setting.
Get the JavaScript tag URL prefix
The ODP JavaScript tag loads from Amazon CloudFront, the AWS content delivery network that hosts the tag script. The URL prefix tells your storefront where to load the tag from.
- Go to Data Setup > Integrations.
- Click JavaScript Tag and Don't Minify to view a more readable script.
- In the tag code, find the script.src line.
- Copy only the CloudFront domain name and version, such as SUBDOMAIN.cloudfront.net/v2/, for the SearchService__ODP__ScriptUrlPrefix setting. Do not include https:// or any text after the version.
Add the settings to your local configuration
Add the ODP settings to the appSettings.config file or the .env file of your local Configured Commerce site. Replace each empty value with the value from the ODP dashboard. Keep the ApiUrl and S3Region values as shown.
Important The private API key and the AWS secret key grant access to your ODP data. Do not commit these keys to source control or share them. Add your local configuration file to .gitignore to keep it out of your repository.
The following example shows the settings in appSettings.config:
<add key="SearchService__ODP__ApiUrl" value="https://api.zaius.com/v3" />
<!-- API keys -->
<add key="SearchService__ODP__PrivateApiKey" value="" />
<add key="SearchService__ODP__PublicApiKey" value="" />
<!-- AWS integration credentials -->
<add key="SearchService__ODP__S3AccessKey" value="" />
<add key="SearchService__ODP__S3ExportBucketName" value="" />
<add key="SearchService__ODP__S3ImportBucketName" value="" />
<add key="SearchService__ODP__S3Region" value="us-east-1" />
<add key="SearchService__ODP__S3SecretKey" value="" />
<!-- JavaScript tag script URL prefix -->
<add key="SearchService__ODP__ScriptUrlPrefix" value="" />The following example shows the same settings in .env:
SearchService__ODP__ApiUrl=https://api.zaius.com/v3
# API keys
SearchService__ODP__PrivateApiKey=
SearchService__ODP__PublicApiKey=
# AWS integration credentials
SearchService__ODP__S3AccessKey=
SearchService__ODP__S3ExportBucketName=
SearchService__ODP__S3ImportBucketName=
SearchService__ODP__S3Region=us-east-1
SearchService__ODP__S3SecretKey=
# JavaScript tag script URL prefix
SearchService__ODP__ScriptUrlPrefix=Configured Commerce uses the settings for the following parts of the integration:
- Real-time sync – ApiUrl and PrivateApiKey.
- Bulk export jobs – S3AccessKey, S3SecretKey, S3ImportBucketName, S3ExportBucketName, S3Region, and PublicApiKey.
- Storefront events – ScriptUrlPrefix and PublicApiKey.
Configure the Admin Console
Turn on ODP tracking in the Admin Console of your local site. Follow the steps in Enable ODP in Configured Commerce.
Integration jobs export data to ODP in bulk. If your custom work uses integration jobs, configure a connection and a job definition.
Configure the integration connection
A connection defines where integration jobs run.
- In the Admin Console, go to Administration > Jobs > Connections.
- Select an existing connection, such as Internal, or add a connection to run your integration jobs. New connections should be set to Runs On = Internal.
Configure an integration job
A job definition sets the connection and the postprocessor that the export job uses.
- Go to Administration > Jobs > Job Definitions.
- Click New Job Definition.
- Enter a name in the Job Name field, such as Custom Product Export.
- Select a connection from the Connection drop-down list, such as Internal.
- Select a postprocessor from the Post Processor drop-down list, such as ProductOdpExport or your custom postprocessor.
- Click Save.
Verify the setup
Run a test job to confirm that your local site sends data to ODP.
- Restart your local Configured Commerce application to load the updated settings.
- Run your test job, such as the custom product export.
- Confirm that the job completed in Administration > Jobs > All Job History.
- In the ODP dashboard, go to Settings > Activity Log.
- Confirm that the log shows a File Import entry for your file. A completed import shows a message such as Finished import from odp_products_TIMESTAMP.csv.