Setting Up The WooCommerce Google Ads API

Alpha Insights Documentation

Google Ads API Configuration

blank

What Does This Feature Do?

This is by far one of our most requested features and the feature that we also think will bring the most value to Alpha Insights.

This feature does a number of things, it essentially bridges the data gap between your WooCommerce store and your Google Ads account.

This feature does a few things:

  1. It will automatically import expenses from your Google Ad spend to calculate your store’s profit reliably without intervention from you
  2. It will produce a report (a small sample of the report above) to display key metrics and overviews for your entire ad account and specific campaigns.
  3. We also use the API to check which orders belong to which campaigns, outside of the usual Google attribution (providing more accurate results).
    This means that we can assess the ACTUAL profitability of your Google Campaigns as we have all revenue collected, all costs & a comparison against each campaign. This will allow you to truly calculate the profitability of your campaigns. 
  4. We also include settings to create custom conversions within your Google Ad account to track Order Profit and Add To Carts. These are saved as custom conversions labelled Alpha Insights – Order Profit and Alpha Insights – Add To Cart, respectively. You can read more about that below.

Setting Up Your API Connection

blank

1. Login To The Google Ads API

Go to Alpha Insights > Settings > Google Ads

On this page you will find the Login WIth Google button, click this and follow the prompts.

You will be asked to login to Google, request relevant permissions, and asked to select the appropriate Google Account.

Please note, you can only configure one account per installation for the time being.

2. Select A Google Ad Account

When you log into and authenticate your connection with the Google API, we fetch for all available ad accounts that you have access to under that google account, and store them for you to use for your API configuration.

If you do not have the appropriate permission to access that Google Ad Account within the Google Account you logged in through, it will not show up, so make sure that you have the relevant permissions on a particular ad account that you are trying to configure under the Google Account that you logged in to.

If you feel like you have not got the ad accounts available that you think you should, you can use the Fetch for Available Ad Accounts button which will re-check your account for available ad accounts that you have access to.

That’s it, once you see a green dot on both section then you are configured.

If you run into any issues, they will normally display as messages at the top of this settings page, or will be available at the bottom of this settings page under the error log.

3. Once You’re Configured You Should Fetch For Data:

There is an automatic process that fetches and stores data, but if you’re keen to hit the ground running just hit the Refresh All Data button at the top right of the settings page.

This will fetch and store all expenses and data points to be used in expense calculation and campaign reports.

Setting Up Alpha Campaign Profit Tracking​

Enable Accurate Profit Tracking By Connecting WooCommerce Orders To A Google Ads Campaign

In order to track which orders belong to which Google Campaign, you need to add a query parameter value for the campaign ID to your final URL that allows us to see which campaign a click belongs to.

Add the following query parameters to your landing page URL: google_cid={campaignid}

E.g. Your landing page may look like this: https://yoursite.com/products/hat/?utm_campaign=yourcampaign&utm_source=google_ppc&google_cid={campaignid}

Google does occasionally change their dynamic parameters, so just make sure that {campaignid} is correct.

A schedule will run in your website that will check orders every hour for the presence of this meta key, store it if found & then use this data in the Google Ads Campaign Report.

Below is an example of how to do this in your Google Ads setup.

blank

The Settings

blank

API Call Schedule

This determines how frequently we should fetch for data from your Google Ad Account. The more often you are fetching the more tolling it is on your server, so if you’re concerned about performance i’d leave it to once a day.

This fetch will collect and store expenses and also collect campaign data and store it within a campaign custom post type.

Ad Spend Expense Category

This is the expense category in which we will store your Google Campaign Ad spend against, we will try create one, otherwise you can create one or select an existing one.

Ad Account Age (Years)

When we check for all time data, we will search back this many years.

The Google API does not allow us to just search all time, we need to set specific dates, so by default we will search up to 10 years back.

If your ad account is older than 10 years you can set this to a higher number, but it may create a very large request that may not be succesful depending on how active you are in Google Ads.

Conversion Actions For Custom Conversion Tracking

blank

Tracking Order Profit & Add To Carts In Google Ads

We’ve included two settings for creating two custom conversion actions.

These are Order Profit and Add To Cart.

The Order Profit conversion, will receive the actual order profit as the conversion value, allowing you to optimize your campaigns for profit, rather than revenue.

The Add To Cart conversion will collect add to cart events from your website, and track the value of those too.

To set this up, all you need to do is click create on each of these buttons, and we will automatically create these custom conversion in your Google Ad Account (after your ad account has been configured).

Once you see the success message for each, and reload the page, you should see the following successful states below.

blank

You should then be able to view these custom conversion by going to your Google Ads account and going to Goals > Summary > View All Conversion Actions.

Alpha Insights will automatically send conversions to these custom conversions once you have configured correctly from the Alpha Insights dashboard.

blank

Important Notes

Connecting Orders to Google Campaigns

It’s important to include the query parameter in all of your Google Ads for google_cid={campaignid}. 

Alpha Insights relies on this information to report on revenue, so without these tags in your final URLs you will not see revenue reported against your Google Campaigns. 

Debugging

Any errors in the Google API will be logged and reported at the bottom of your Google Ads setting page within Alpha Insights.

Most errors are temporary, they are most likely to be timeout issues, which are not permanent and do not effect the ongoing capacity of your installation.

For any queries or concerns, you can reach us at support@wpdavies.dev

Got A Question?

Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
blank
Alpha Insights

Alpha Insights

The World's Most Advanced WooCommerce Reporting Plugin.

WooCommerce Cost Of Goods Order Profit Reports