Skip to content
TrueROASDocs
DocsIntegrations

How do I connect my WooCommerce store and add its API keys?

Install the TrueROAS WordPress plugin, then add WooCommerce API keys with read and write access so TrueROAS can import your past orders.

The two parts of a WooCommerce connection

  • The TrueROAS plugin for WordPress connects your WooCommerce store to TrueROAS.
  • WooCommerce API keys let TrueROAS read your past orders, so it can import them. The import itself is explained in How do I bring in orders from before I installed TrueROAS?.

Add your store to TrueROAS first, with the same address as your WordPress site, for example mywoostore.com. TrueROAS uses that address to reach your shop when it checks your API keys. See How do I add a store to TrueROAS?.

Install the plugin

  1. Click General Settings at the bottom of the left menu and open the Store Settings tab.
  2. Under Store Platforms, find the WooCommerce Plugin card (Connect your WooCommerce store with our WordPress Plugin) and click Install. The TrueROAS plugin opens in the WordPress plugin directory in a new tab.
  3. Install and activate the plugin in your WordPress admin.

The Install Woo Plugin button on the setup card at the top of the Dashboard opens the plugin search in your own WordPress admin instead. Once the plugin is installed, the same card shows whether visits and orders are coming in. See What does the setup card at the top of the Dashboard mean?.

Create your API keys in WooCommerce

TrueROAS shows these steps under How to generate your API keys:

  1. In your WordPress admin, go to WooCommerce, then Settings, Advanced and REST API. In TrueROAS you can also click click here to open it directly, which opens that page of your shop in a new tab.
  2. Click Add key (or Create an API key).
  3. In the Description field, type TrueROAS, or any name you like.
  4. Make sure the User list is set to your admin account.
  5. Set Permissions to Read/Write.
  6. Click Generate API key.
  7. Copy the Consumer Key, which starts with ck_, and the Consumer Secret, which starts with cs_.

Warning: Important: The Consumer Secret is only shown once. Make sure to copy it before closing the page.

Add the keys to TrueROAS

When you add a WooCommerce store that is new to TrueROAS, TrueROAS asks for the keys right after the store is added, under Connect Your WooCommerce API (Enter your REST API keys to import historical orders with attribution data.). Paste them and click Connect API, or click Skip for now to add them later. Attribution is how TrueROAS decides which ad gets the credit for a sale.

To add them later:

  1. Click General Settings at the bottom of the left menu and open the Store Settings tab.
  2. Under Store Platforms, find the WooCommerce API Keys card (Manage your WooCommerce REST API keys for order import) and click Connect.
  3. The WooCommerce API Keys window opens. A yellow note at the top says the store is not connected and that API keys are needed to import order data.
  4. Paste your keys into Consumer Key (ck_...) and Consumer Secret (cs_...). Spaces before or after a key are removed, and the secret is hidden as you type.
  5. Click Connect API. TrueROAS tries to read one order from your shop with the keys, and saves them only when that works.
  6. You see API keys connected successfully!. The window now shows Connected with the date the keys were saved, and the card shows Connected with a Manage button.

If the keys are not accepted

A red message in the window tells you what went wrong:

MessageWhat to do
Invalid API keys. Please check your Consumer Key and Consumer Secret.WooCommerce did not accept the keys. Copy both keys again, or create a new key with Read/Write permissions.
Could not connect to your store's API (status 404). Make sure the WooCommerce REST API is enabled. The number can differ.Your shop answered, but not with your orders. Check that the WooCommerce REST API is turned on.
Could not connect to your store's API. Make sure WooCommerce REST API is enabled and your store URL is correct.Check the REST API and the address your store was added with.
Could not reach your store. Please check that your store URL is correct and the WooCommerce REST API is enabled.TrueROAS could not reach your shop at its address. Check that the store address in TrueROAS is your WordPress site.
Failed to connect. Please check your API keys and try again.Something else went wrong. Try again in a moment.

Replace the keys

  1. Click Manage on the WooCommerce API Keys card.
  2. Under Enter new keys below to update your connection., paste the new Consumer Key and Consumer Secret.
  3. Click Update API Keys.

Good to know

  • The keys are saved for the whole store. Anyone on the store who can open the Store Settings tab sees whether they are connected.
  • TrueROAS only uses the keys to import your past orders. How many orders and how far back is explained in How do I bring in orders from before I installed TrueROAS?.
  • You cannot remove the keys in TrueROAS, only replace them. To stop TrueROAS using them, revoke the key under WooCommerce, Settings, Advanced and REST API in your WordPress admin.
  • The WooCommerce Plugin card does not show whether the plugin is installed. Check the setup card on the Dashboard instead.
  • The WooCommerce API Keys card only shows on stores added as WooCommerce stores.
  • The Store Settings tab is part of General Settings, which needs your Settings permission set to View or Edit. See What is General Settings and what can I do there?.
  • On a phone, the WooCommerce API Keys window fills the whole screen. Close it with the X in the top right corner.