Categories
Facebook Ads

Facebook Ads Default Column Setup

Here is my recommended Facebook default column setup for ROI focused e-commerce campaigns, that should enable you to quickly see the performance of your campaigns and adsets.

First go to the Campaign view and then into:
Columns Icon > Customize Columns

Select the following columns in this order:

OrderColumn Name
1Object Names & Ids > Campaign Name
2Object Names & Ids > Ad Set Name
3Performance > Delivery
4Ad Relevance Diagnostics > Quality Ranking
5Performance > Impressions
6Performance > Reach
7Performance > Clicks (All)
8Clicks > Outbound Clicks
9Performance > CTR (All)
10Clicks > Outbound CTR
11Conversions > Adds to Cart: Total
Deselect all sub-categories
12Conversions > Purchases: Total
Deselect all sub-categories
13Conversions > Purchases: Value
Deselect all sub-categories
14Conversions > Purchases: Cost
Deselect all sub-categories
15Performance > Amount Spent
16Goal, Budget & Schedule > Budget
17Performance > Frequency
18Conversions > Website Purchase ROAS (Return on Ad Spend)

Select “Save as Preset” and name your column set “ROAS”

Click the column icon and select “Set as Default”

Optional: Custom Columns

Optionally, create the following custom columns

% Cost of Sales

This indicates what percentage of your sales are going towards Facebook ads cost. This metric is the inverse of ROAS, but is often easier to understand for business owners, as it shows ad spend as a cost of sales.

NameCost of Sales
FormatPercentage
DescriptionAd spend as a % of revenue.
FormulaAmount Spent ÷ Purchases Conversion Value
Who can access thisEveryone
Categories
Digital Marketing Google Ads

Device Bid Adjustments for Google Ads

Conversion rates can vary a great deal across devices, and so it makes sense to bid differently for Mobile vs Desktop vs Tablet. Here two methods to calculate your bid adjustment, as well as an automated bidding script that will do all the work for you!

Calculating based on Conversion Rates

The simplest way is to calculate bid adjustments based on the individual device conversion rates relative to the Campaign average

Calculating based
on Click Value

I believe a more correct way is to calculate bid adjustments based on the relative per click values of each device (the Conv. Value / Click column)

Example Using Real Data

Sample Campaign

DeviceConv. rateConv. value / clickAdjustment
(Conv. Rate)
Adjustment
(Click Value)
Mobile1.15%$6.90-40%-43%
Desktop3.01%$20.20+57%+68%
Tablet0.89%$1.85-54%-85%
Campaign1.91%$12.03

Automating Bid Adjustments

Below is a Google Ads Script that will automatically make these adjustments for you (based on relative conversion rate). You can download the latest version of this script on GitHub here:
Google Ads Device Bid Adjustment Script

// Version: 1.13.1 Muppet
// Latest Source: https://github.com/Czarto/Adwords-Scripts/blob/master/device-bid-adjustments.js
//
// This Google Ads Script will incrementally change device bid adjustments
// based on conversion rates using the Campaign's average conversion rate
// as a baseline.
//

/***********

MIT License

Copyright (c) 2016-2021 Alex Czartoryski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

**********/

var LABEL_PROCESSING_DESKTOP = "_processing_desktop";
var LABEL_PROCESSING_MOBILE = "_processing_mobile";
var LABEL_PROCESSING_TABLET = "_processing_tablet";

var BID_INCREMENT = 0.05;       // Value by which to adjust bids
var MIN_CONVERSIONS = 10;       // Minimum conversions needed to adjust bids.
var MAX_BID_ADJUSTMENT = 1.90;  // Do not increase adjustments above this value



function main() {
    initLabels(); // Create Labels

    /*****
      Device performance *should* theoretically not vary over time
      (unless a site redesign has been performed) and so it makes
      most sense to use a relatively long time period (1 year)
      on which to base adjustments.

      Shorter time periods included for reference, but commented out
    *****/

    //setDeviceBidModifier("LAST_7_DAYS");
    //setDeviceBidModifier("LAST_14_DAYS");
    //setDeviceBidModifier("LAST_30_DAYS");
    //setDeviceBidModifier(LAST_90_DAYS(), TODAY());
    setDeviceBidModifier(LAST_YEAR(), TODAY());

    cleanup(); // Remove Labels
}


//
// Set the Processing label
// This keeps track of which bid adjustments have already been processed
// in the case where multiple time-lookback windows are being used
//
function initLabels() {
    checkLabelExists();
    cleanup();

    var itemsToLabel = [AdWordsApp.campaigns(), AdWordsApp.shoppingCampaigns()];

    for (i = 0; i < itemsToLabel.length; i++) {
        var iterator = itemsToLabel[i].get();

        while (iterator.hasNext()) {
            campaign = iterator.next();
            campaign.applyLabel(LABEL_PROCESSING_DESKTOP);
            campaign.applyLabel(LABEL_PROCESSING_MOBILE);
            campaign.applyLabel(LABEL_PROCESSING_TABLET);
        }
    }
}



//
// Create the processing label if it does not exist
//
function checkLabelExists() {

    var labels = [LABEL_PROCESSING_DESKTOP, LABEL_PROCESSING_MOBILE, LABEL_PROCESSING_TABLET];

    for (i = 0; i < labels.length; i++) {
        var labelIterator = AdWordsApp.labels().withCondition("Name = '" + labels[i] + "'").get();
        if (!labelIterator.hasNext()) {
            AdWordsApp.createLabel(labels[i], "AdWords Scripts label used to process device bid adjustments");
        }
    }
}


//
// Remove Processing label
//
function cleanup() {
    var cleanupList = [AdWordsApp.campaigns(), AdWordsApp.shoppingCampaigns()];

    for (i = 0; i < cleanupList.length; i++) {
        var iterator = cleanupList[i].get();

        while (iterator.hasNext()) {
            campaign = iterator.next();
            campaign.removeLabel(LABEL_PROCESSING_DESKTOP);
            campaign.removeLabel(LABEL_PROCESSING_MOBILE);
            campaign.removeLabel(LABEL_PROCESSING_TABLET);
        }
    }
}


//
// Set Device Bids
//
function setDeviceBidModifier(dateRange, dateRangeEnd) {

    var STANDARD = 0;
    var SHOPPING = 1;

    for (i = 0; i < 2; i++) {
        //Logger.log('---  ' + (i==STANDARD ? 'Standard Campaigns' : 'Shopping Campaigns'));

        var labels = [LABEL_PROCESSING_DESKTOP, LABEL_PROCESSING_MOBILE, LABEL_PROCESSING_TABLET];

        for (l = 0; l < labels.length; l++) {
            //Logger.log('     ' + labels[l]);

            var campaigns = (i==STANDARD ? AdWordsApp.campaigns() : AdWordsApp.shoppingCampaigns());
            var campaignIterator = campaigns.forDateRange(dateRange, dateRangeEnd)
                .withCondition("Status = ENABLED")
                .withCondition("Conversions >= " + MIN_CONVERSIONS)
                .withCondition("LabelNames CONTAINS_ANY ['" + labels[l] + "']")
                .get();

            while (campaignIterator.hasNext()) {
                var campaign = campaignIterator.next();
                var baseConversionRate = campaign.getStatsFor(dateRange, dateRangeEnd).getConversionRate();
                var platforms = [campaign.targeting().platforms().desktop(),
                    campaign.targeting().platforms().mobile(),
                    campaign.targeting().platforms().tablet()
                ];

                //Logger.log('    CAMPAIGN: ' + campaign.getName());

                var targetIterator = platforms[l].get();
                if (targetIterator.hasNext()) {
                    var target = targetIterator.next();
                    var stats = target.getStatsFor(dateRange, dateRangeEnd);
                    var conversions = stats.getConversions();
                    var conversionRate = stats.getConversionRate();
                    var targetModifier = (conversionRate / baseConversionRate);
                    var currentModifier = target.getBidModifier();

                    //Logger.log('    Conversions: ' + conversions);
                    
                    if (conversions >= MIN_CONVERSIONS) {
                        if (Math.abs(currentModifier - targetModifier) >= BID_INCREMENT) {
                            if (targetModifier > currentModifier) {
                                target.setBidModifier(Math.min(currentModifier + BID_INCREMENT, MAX_BID_ADJUSTMENT));
                            } else {
                                target.setBidModifier(Math.max(currentModifier - BID_INCREMENT, 0.1));
                            }
                        }

                        campaign.removeLabel(labels[l]);
                        //Logger.log('    Remove Label: ' + labels[l]);
                    }
                }

            }
        }
    }
}

//
// Date range helper function
// Returns today's date
//
function TODAY() {
    var today = new Date();
    var dd = today.getDate();
    var mm = today.getMonth() + 1; //January is 0!
    var yyyy = today.getFullYear();

    return { year: yyyy, month: mm, day: dd };
}

//
// Date range helper functions
// Returns date 90 days ago
//
function LAST_90_DAYS() {
    var date = new Date(); 
    date.setDate(date.getDate() - 90);
    
    var dd = date.getDate();
    var mm = date.getMonth()+1; //January is 0!
    var yyyy = date.getFullYear();
  
    return {year: yyyy, month: mm, day: dd};
  }

//
// Date range helper functions
// Returns date 1 year ago
//
function LAST_YEAR() {
    var today = TODAY();

    today.year = today.year - 1;
    return today;
}

The latest version of this script is available on GitHub here:
Google Ads Device Bid Adjustment Script

Install the script and have it run once per week.

Every week, the script will look at the past 365 days of data for each of your Search and Shopping campaigns, and make device bid adjustments based on conversion rates.

The script will raise and lower your device bid adjustments by up to 5% each week (you can change this value if you prefer bigger adjustments). You can also adjust the date range for which you want the script to run, and what the minimum number of conversions are required to make a change.

Additional Resources

Categories
Digital Marketing Facebook Ads Google Ads

Adjusting Campaign Budgets towards a Target ROAS

Pop Quiz!

You have been running a campaign for 7 days with a daily budget of $50. Over those 7 days you have spent $350 with an ROAS of 1500%. You are using a “Maximize ROAS” bid strategy, and want to hit an ROAS of 2000%.

What should your daily budget be?

Here is the formula:

Formula to adjust budget towards a target ROAS
Formula for adjusting a budget towards a target ROAS

This formula calculates what your daily spend should have been to hit your target ROAS. Although there are no guarantees that future performance will be the same as past performance, it does provide a baseline from which to work.

If you are running a smart bidding campaign in either Google Ads or Facebook Ads, and are aiming for a target Return on Ad Spend (ROAS), this is a great formula to use for adjusting your budgets.

The Answer

Sample Campaign
Total Cost$50×7 = $350
# of Days7
Current ROAS1500%
Target ROAS2000%

Using the formula above we get:

New Daily Budget = $350 ÷ 7 × 1500 ÷ 2000 = $37.50

By reducing our budget from $50 to $37.50, we should be in better shape to hit our target ROAS of 2000%.

Related Reading

Categories
Digital Marketing Google Ads

Essential Google Ads Custom Columns

Here are some incredibly useful custom columns that I add to every Google Ads account I manage:

Column NameFormulaType
ROASConv. Value ÷ Cost%
Cost of Sales (COS)Cost ÷ Conv. Value%
% COS CPCConv. Value ÷ Clicks x %$
Optimistic
% COS CPC
(Conv. Value + (Conv. Value ÷ Conversions)) ÷ Clicks x %$

Below is each column described in more detail:

ROAS

ROAS stands for Return On Ad Spend

NameROAS
DescriptionReturn on Ad Spend
FormulaConv. Value ÷ Cost
Data FormatPercent (%)

This metric tells you the percentage of revenue generated for each dollar in ad spend.

100% ROAS means that there is a 1:1 relationship between your revenue and ad spend. For every $1 spent, you generated $1 in revenue.

200% ROAS means that is a 2:1 relationship between your revenue and ad spend. For every $1 spent, you generated $2 in revenue.

Many of the automated bidding strategies in Google Ads let you specify a target ROAS goal (Return on Ad Spend), so adding this custom column allows you quickly see in a glance if your campaigns, ad groups, and keywords are meeting your ROAS targets.

COS (Cost of Sales)

COS stands for Cost Of Sales

NameCOS
DescriptionCost of Sales
FormulaCost ÷ Conv. Value
Data FormatPercent (%)

This metric is the inverse of ROAS. It tells us what percentage of revenue was spent on ads.

This metric is usually more aligned with how most businesses look at Ad Spend (as a cost). I find looking at things from a Cost of Sales standpoint makes more sense than ROAS for most businesses. (ROAS is more aligned with how ad agencies think about ad spend).

20% Cost of Sales means that for every $1 in revenue, we spent $0.20 on ads.

If you know your profit margins, then it’s easy to see when your Cost of Sales exceeds those margins, and when you start to lose money on every sale.

To convert between ROAS and COS use these formulas:

Cost of Sales (COS) = 1 / ROAS

Return on Ad Spend (ROAS) = 1 / COS

% COS CPC

What is the max Cost per Click bid that will keep me below the specified % Cost of Sales target.

Name5% COS CPC
DescriptionMaximum CPC to stay below 5% Cost of Sales
FormulaConv. Value ÷ Clicks x 0.05
Data FormatMoney ($)

If you use Manual CPC bidding for a campaign, creating a few of these columns for various profit margins will give you access to quick calculation for what your max CPC bids.

I usually create a few of these columns. Eg:

5% COSMax CPC bid to hit 5% cost of sales
35% COSMax CPC bid to hit 35% cost of sales
55% COSMax CPC bid to hit 55% cost of sales

The number of columns you create and the values you use will depends on your business and profit margins. I usually create one column that targets a very low cost of sales (eg: 5%, that is used for Branded search bids), and then another column that targets my maximum profit margin (eg: 55%, that is used for Unbranded/Prospecting search bids).

Optimistic % COS CPC

What is the max Cost per Click bid that will keep me below the specified % Cost of Sales target, under the assumption that the next click will result in a sale

NameOptimistic 5% COS CPC
DescriptionMaximum CPC to stay below 5% Cost of Sales, assuming the next click will result in a sale
Formula(Conv. Value + (Conv. Value ÷ Conversions)) ÷ Clicks x 0.05

or use a harde-coded order value:
(Conv. Value + avg_order_value) ÷ Clicks x 0.05
Data FormatMoney ($)

This custom column is similar to the % COS CPC column above, except that it is optimistic in assuming that the “next click” will result in a sale, and includes the next sale’s revenue in the Max cost per click calculations.

You can either hard-code your average conversion value, or you can calculate it based on past conversion data.

This column is useful when you are starting a new campaign where you don’t have much conversion data yet, and you want to be optimistic with your bidding.

Further Reading

Categories
Digital Marketing Google Ads Shopify Shopping

Enhance Shopify’s Google Shopping feed

The following script will allow you to enhance Shopify’s Google Shopping app feed to include:

  • Sale Price annotations
  • Additional Images by Variant: More control over which product images get associated with which variant.
  • Exclude Out of Stock items from Google Programs. If you are paying to advertise, make sure you are only paying to display products you can sell.
  • Exclude Low Stock variants from Google Programs. Exclude color ways that have low size options. Show other color options or products instead.
Sale annotation in Google Shopping
SALE labels and price markdown annotations usually only appear if you provide Google Shopping with both your regular price (compare_at_price) and your sale price.

To add the above functionality, you must create and upload a supplemental data feed to Google Merchant Center.

Step 1
Create a Supplemental Data Feed in Shopify

The first step is to create a data feed in Shopify. We can accomplish this by creating a custom Shopify Collection Template that will output XML data instead of HTML:

1. Create a new Collection Template called collection.google-update.liquid with the following code:

{% layout none %}<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">

{% comment %}
Google Shopping / Merchant Center + Shopify Product Update Feed by Alex Czartoryski
https://business.czarto.com/2020/08/12/shopify-sale-price-google-shopping/

This version: Oct 14, 2020
The latest version of this script available here:
https://github.com/Czarto/ShopifyScripts/blob/master/Templates/collection.google-feed-update.liquid
{% endcomment %}

{% comment %} Settings {% endcomment %}
{%- assign exclude_unavailable_variants = true -%}
{%- assign exclude_variant_colors_with_limited_availability = true -%}
{%- assign ignore_x_smallest_sizes = 1 -%}
{%- assign ignore_x_largest_sizes = 1 -%}
{%- assign minimum_percentage_availability = 50 -%}
{%- assign filter_variantImages_byColor = true -%}

{%- assign CountryCode = 'US' -%}
{%- if shop.currency == 'CAD' -%}{%- assign CountryCode = 'CA' -%}{%- endif -%}

<channel>
<title>{{ shop.name }} {{ collection.title | strip_html | strip_newlines | replace: '&', '&amp;' }}</title>
<link>{{ shop.url }}</link>
<description>{{ collection.description | strip_html | strip_newlines | replace: '&', '&amp;' }}</description>

{%- paginate collection.products by 1000 -%}
{%- for product in collection.products -%}

{%- comment -%} Get color option {%- endcomment -%}
{%- for option in product.options -%}
{%- if option == 'Color' -%}{% capture option_color %}option{{ forloop.index }}{% endcapture %}{%- endif -%}
{%- endfor -%}

{%- comment -%} Make a list of Colors to exclude {%- endcomment -%}
{%- assign colors_to_exclude = "" -%}
{%- if exclude_variant_colors_with_limited_availability -%}
{%- for color in product.options_by_name['Color'].values -%}
{%- assign variants = product.variants | where: option_color, color -%}
{%- assign variants_to_process_count = variants.size | minus:ignore_x_smallest_sizes | minus:ignore_x_largest_sizes -%}
{%- assign available_count = 0 -%}
{%- assign total_processed_count = 0 -%}
{%- for variant in variants offset:ignore_x_smallest_sizes limit:variants_to_process_count -%}
{%- assign total_processed_count = total_processed_count | plus:1 -%}
{%- if variant.available -%}{%- assign available_count = available_count | plus:1 -%}{%- endif -%}
{%- endfor -%}
{%- if total_processed_count == 0 -%}
{%- continue -%}
{%- endif -%}
{%- assign percentage_availability = available_count | times: 100.0 | divided_by: total_processed_count | round -%}
{%- if percentage_availability < minimum_percentage_availability -%}
{% capture colors_to_exclude %}{{colors_to_exclude}}#{{ color }}{%endcapture%}
{%- endif -%}
{%- endfor -%}
{%- assign colors_to_exclude = colors_to_exclude | split: "#" -%}
{%- endif -%}

{%- for variant in product.variants -%}
<item>
<g:item_group_id>shopify_{{ CountryCode }}_{{ product.id }}</g:item_group_id>
<g:id>shopify_{{ CountryCode }}_{{ product.id }}_{{ variant.id }}</g:id>
<g:mpn>{{ variant.sku }}</g:mpn>

{%- comment -%} Sale Price {%- endcomment -%}
{%- if variant.compare_at_price > variant.price -%}
{%- assign variant_onSale = true -%}
{%- assign variant_price = variant.compare_at_price -%}
{%- assign variant_salePrice = variant.price -%}
<g:price>{{ variant_price | money_without_currency }} {{ shop.currency }}</g:price>
<g:sale_price>{{ variant_salePrice | money_without_currency }} {{ shop.currency }}</g:sale_price>
{% endif %}

{%- comment -%} Additional Images by Color {%- endcomment -%}
{%- assign additional_images = product.images -%}
{%- for option in product.options -%}
{%- if option == 'Color' -%}{% capture variant_color %}{{ variant.options[forloop.index0] }}{% endcapture %}{%- endif -%}
{%- endfor -%}
{% if filter_variantImages_byColor %}{% assign additional_images = product.images | where: "alt", variant_color | sort: 'attached_to_variant' | reverse%}{% endif %}
{% if additional_images.size > 1 %}{%- for image in additional_images offset:1 limit:10 -%}
<g:additional_image_link>https:{{ image.src | product_img_url: 'master' }}</g:additional_image_link>
{% endfor %}{% endif %}

{%- comment -%} Exclude Out of Stock Variants {%- endcomment -%}
{% if exclude_unavailable_variants and variant.available == false %}
<g:excluded_destination>Display ads</g:excluded_destination>
<g:excluded_destination>Shopping ads</g:excluded_destination>
<g:excluded_destination>Shopping Actions</g:excluded_destination>
{% elsif exclude_variant_colors_with_limited_availability and colors_to_exclude contains variant_color %}
<g:excluded_destination>Display ads</g:excluded_destination>
<g:excluded_destination>Shopping ads</g:excluded_destination>
<g:excluded_destination>Shopping Actions</g:excluded_destination>
{% endif %}
</item>

{% endfor %}
{% endfor %}
{% endpaginate %}
</channel>
</rss>

Available on github here

2. Create a new collection called “google-update” and choose google-update as your collection template.

3. Preview the collection and copy the url. Your url should look something like this: yourstoredomain.com/collections/google-update

Step 2
Configure your Feed

There are a few options you can configure in your feed, all located towards the top of your template file in the “configuration” section.

Sale Priceautomatic
Exclude Out of Stock Variants
exclude_unavailable_variants

true
Exclude Limited Stock Color Variants
exclude_variant_colors_with_limited_availability
ignore_x_smallest_sizes
ignore_x_largest_sizes
minimum_percentage_availability

false
1
1
50
Filter Variant Images by Color + Alt Text Matching
filter_variantImages_byColor

false

Sale Price

This is automatically included. If your products have a current price that is less than the compare_at_price then the appropriate sale price data will be automatically updated in the feed.

Exclude Out of Stock Variants

exclude_unavailable_variants = true

By default, any variants that are out of stock will be excluded from Google Shopping, Google Shopping Actions, and Dynamic Remarketing. Change the value of exclude_unavailable_variants = false if you want to disable this behaviour.

Exclude Limited Stock Color Variants

exclude_variant_colors_with_limited_availability = true

This setting is intended for apparel products, where you may have many colors of a product, but limited sizes available in a specific product. Setting this value to true will cause the script to attempt to exclude the colors with low availability (so that alternative colors or products can show instead).

There are a few additional configuration items for this setting that you can change:

minimum_percentage_availability
default = 50
Minimum % of sizes available before all variants of this color are excluded.
ignore_x_smallest_sizes
default = 1
Ignore the x smallest sizes in the % available calculation
ignore_x_largest_sizes
default = 1
Ignore the x largest sizes in the % available calculation

Filter Variant Images by Color
and Alt Text Matching

filter_variantImages_byColor = true

Setting this value to true will assign additional images to the current variant where the image’s Alt Text matches the variant’s color. Note that the primary variant’s image will always be included in the feed regardless of Alt text.

Step 3
Add a Supplemental Data Feed in Google Merchant Center

1. Open Merchant Center and go to
Products > Feeds > Supplemental Feeds > Add Supplemental Feed

NameFeed Update Script
Feed TypeScheduled Fetch
File Namegoogle-update
File Urlyourstoredomain.com/collections/google-update

Leave everything else as default values and click Continue

2. Make sure there’s a checkmark beside Content API and click Create Feed

3. You should now see your newly created feed in the Supplemental Feeds section. Click on your feed’s name and then click on Fetch Now to update your product data now.

Testing

It may take up to 30 minutes for your main feed to be updated. It is a good idea to review your products and feed to ensure that everything is coming through as expected, and tweak as required.

If everything looks good, your new sale pricing, variant images, and program availability should now be updated once per day.

Related Reading

Categories
Attribution Digital Marketing eCommerce Google Ads Shopify

Optimize Shopify’s Google Ads Conversion Tracking

Here are some essential changes to make to your Google Ads conversion tracking after you connect Shopify’s Google Shopping Channel.

STEP 0
Install the Google Shopping Channel

This guide assumes that you have the Google Shopping Channel installed on your Shopify store. If this is not the case, then:

  1. Install the Google Shopping Channel
  2. Connect your Google Account (must be an account that has access to both Google Merchant Center and Google Ads)
  3. Connect your Google Ads Account in the “Smart Shopping campaign” section

STEP 1
Remove Old Conversion Tracking Code

By connecting Shopify to Google Ads via the Google Shopping Channel, Shopify will begin sending conversion data to your Google Ads account. If you were already tracking conversions in Google Ads, then you need to make sure you are not duplicating your conversion data:

  • If you previously had a Google Ads conversion tracking script installed in your checkout, then remove that code.
  • If you were importing conversions from Google Analytics, stop importing those conversions.

STEP 2
Fix Conversion Categories

Log into Google Ads and then Go to
Tools & Settings > Measurement > Conversions

You should see a bunch of new conversion actions created by Shopify. You will also see a warning that your conversion categories are out of date, and that you should update 4 of your conversions actions.

Click Update Now and update the settings to the following:

STEP 3
Conversion Windows and Attribution Models

Although Shopify created multiple conversion actions, you only need to worry about the Google Shopping App Purchase conversion event.

Click on the Google Shopping App Purchase conversion action and update the following settings:

Old ValueNew Value
CountEvery ConversionOne
View-through Conversion Window30 days1 day
Attribution ModelLast clickLinear

One Conversion per click

If you count “Every Conversion” you increases the risk of double attribution across your various channels.

For example: A user clicks on your Google ad and makes a purchase. It makes sense to count and attribute this conversion to Google Ads. If this same user later receives your newsletter, and purchases again, then you probably want to attribute that sale to the Newsletter and NOT to Google. Setting conversion count to “One” instead of “Every” ensures that only the first sale gets attributed to google, and not the second.

Counting “Every” conversion increases the risk of double attribution

Click-Through Conversions

Arguably, you should set your Click-Through Conversion window to 30 days. 90 days seems extremely long, and could increases your chances of double attribution across multiple sales channels.

However, if you are using Smart Campaigns or Smart Bidding, the bidding algorithm can only take into account conversions that have occurred within the specified conversion window. So theoretically, the longer your conversion window, the more data for Smart Bidding to optimize with. So the 90 day click-conversion window can probably stay.

View-Through Conversions

Set the View-Through Conversion window to only 1 day. A longer View-Through conversion window is dangerous, and will lead to over attributing sales to Display Remarketing, YouTube, and Smart Shopping. This will invariably cause you to overspend on those campaigns.

A View-Through conversion window greater than 1 day is dangerous, and will lead to over attributing sales to undeserving channels.

Which Attribution Model to use?

Linear, Time Decay, Position Based, or Data Driven are all better than First or Last click, as they allow you to attribute sales across a wider range of ad interactions, which allows you to spend more evenly across your entire funnel.

I personally usually choose Linear or Position Based, as I like pushing more attribution (and therefore spend) into the top part of the funnel.

STEP 4
Enhanced Conversion Tracking

This option is still in beta, and so you may or may not have access to this in your account. At the bottom of your Purchase conversion action, you should see a section called “Enhanced Conversions”

Expand this section and enter the following settings:

  • Turn on Enhanced Conversions
  • Enter your site URL (ideally your order receipt / thank you page)
  • Choose the Global Site Tag
  • Select “Enter Javascript or CSS Selectors” (note that all of the below are case sensitive. So the first “S” of Shopify needs to be capitalized, and the remaining characters need to be lower case)
  • Email: Javascript: Shopify.checkout.email
  • Phone: Javascript: Shopify.checkout.phone
  • Name and Address: Javascript:
    • Shopify.checkout.billing_address.first_name
    • Shopify.checkout.billing_address.last_name
    • Shopify.checkout.billing_address.address1
    • Shopify.checkout.billing_address.city
    • Shopify.checkout.billing_address.province_code
    • Shopify.checkout.billing_address.country_code
    • Shopify.checkout.billing_address.zip

Click Save

Further Reading

Categories
Analytics Shopify

sag_organic and product_sync in Google Analytics

If you recently installed the Google Shopping channel on Shopify, you may have noticed rise in strange referrals in your Google Analytics reports: Product_sync and sag_organic for medium and campaign parameters.

Where do sag_organic and product_sync come from?

They come from Shopify’s integration with Google Shopping. Specifically from UTM tags added to the product’s link url. When Shopify uploads your product feed to Google Merchant Center, it appends the following UTM tags to the product:

UTM TagValue
utm_sourcegoogle
utm_mediumproduct_sync
utm_campaignsag_organic
utm_contentsag_organic

The following querystring is appended to your product’s link url:

&utm_medium=product_sync&utm_source=google&utm_content=sag_organic&utm_campaign=sag_organic

This usually causes traffic coming from free/organic Google Shopping listings to show up in analytics with a medium of product_sync and Campaign of sag_organic.

What is sag_organic?

The “SAG” in sag_organic stands for Surfaces Across Google.

These parameters are Shopify’s way of helping you track the organic free traffic coming from Google Shopping. The intention is to help you separate Organic Google Shopping traffic from Organic Google Search Traffic.

The ability to get granular is good. But changing default Google Analytics behaviour is often unwelcome (in particular when the change is unexpected).

The default behaviour in Google Analytics for Organic Google Shopping traffic is to include it in the google / organic bucket.

Is it possible to keep default Google Analytics behaviour unchanged, while still gaining the ability to track Organic Google Shopping traffic separately?

The best of both worlds

By leaving source and medium at their default values, and only changing the campaign UTM tag, we can keep default Google Analytics reports unchanged, while gaining the ability to track Organic Shopping traffice separately.

Additionally we can use the content utm tag to track which specific products are sending us traffic.

UTMDefault ValueShopify ValueNew Value
utm_sourcegooglegooglegoogle
utm_mediumorganicproduct_syncorganic
utm_campaign(not_set)sag_organicshopping
utm_content(not_set)sag_organicproduct.title

Step 1
Rewrite the UTM tags

  1. Go to Merchant Center > Products > Feeds
  2. Click on the Content API feed
  3. Click on the Feed Rules tab
  4. Click the big blue PLUS + button, type link in the field, and select link from the drop down.
  5. For Data Source, select Set to, type link and select link from the Primary Feed: Content API list.
  6. Click OK
  7. Set the default behaviour if the link is blank to “Leave Blank”
  8. Now go to Modifications > Add Modification
  9. Choose Optimize URL > Set Parameter
FunctionParameter NameValue
Set Parameterutm_sourcegoogle
Set Parameterutm_mediumorganic
Set Parameterutm_campaignshopping
Set Parameterutm_contenttitle
(processed attribute)
Your link url rules should look something like this.
  1. Click OK and look in the right side column preview to see if the link has been properly updated.
  2. Click Save as Draft and Apply
Your new link rule should look something like the above

If you are using UTM tagging in your Google Ads campaigns, you *may* need to completely clear the UTM tags in Google Merchant Center. You can do this by creating an “Optimize URL” rule with “Remove Parameter” to remove each of the UTM tags individually.

Step 2
Set your Canonical Link

Fixing Shopify’s Partial Implementation
The major problem with the way Shopify implemented the UTM tags, is that they didn’t include a canonical_link as part of the feed. The canonical link ensures that only the “clean” version (without UTM tags) of the product link gets include into Google’s search index.

“If you use tracking parameters in your link attributes, it is recommend that you use the canonical_link attribute to provide a canonical URL. Use the canonical_link attribute to ensure that products are associated with the correct URL in the Google Search index.”

Google Merchant Center Help
https://support.google.com/merchants/answer/188492?hl=en

Add the Canonical Link

Assuming that you are still on the Feed Rules page in Goolge Merchant center:

  1. Click the big blue PLUS + button to add a new Rule and type canonical and choose canonical link from the drop down.
  2. For Data Source, select Set to, type link and select link from the Processed Attributes list.
  3. Click OK
  4. Change the default behaviour if canonical_link has no value to “leave blank”
  5. Add Modification > Find and Replace
    Now we need to add two Find & Replace operations. One to remove the UTM tags and another to remove the Currency parameter that Shopify also appends.
#FindReplaceAdvanced
1&?utm_.+?(&|$)$(leave blank)Search as regular expression
2&currency=(…)(leave blank)Search as regular expression
  1. Click OK and look in the right side column preview to see if the new link looks nice and clean. It should only have the variant id in there.
  2. Click Save as Draft and Apply
Your canonical feed rules should look something like the above

Done!

You may need to wait a few hours for your feed to be update with the new values.

Categories
Digital Marketing Google Ads Shopify Shopping

Add Sale Price to Shopify’s Google Shopping feed

As of Aug 12, 2020 Shopify’s Google Shopping app does NOT send compare_at_price to Google Merchant Center. This means that you are unlikely to receive the SALE annotation in your Google Shopping ads when your products are on sale:

Sale annotation in Google Shopping
SALE labels and price markdown annotations usually only appear if you provide Google Shopping with both your regular price (compare_at_price) and your sale price.

To fix this, you must create and upload a supplemental data feed to Google Merchant Center.

Create a Price Feed in Shopify

The first step is to create a data feed in Shopify containing your products sale and regular prices. We can accomplish this by creating a custom Shopify Collection Template that will output XML data instead of HTML:

1. Create a new Collection Template called collection.xml-sale-pricing.liquid with the following code:

{% layout none %}<?xml version="1.0"?>
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">
{% paginate collection.products by 1000 %}
{%- case shop.currency -%}
{%- when 'USD' -%}{%- assign CountryCode = 'US' -%}
{%- when 'CAD' -%}{%- assign CountryCode = 'CA' -%}
{%- when 'GBP' -%}{%- assign CountryCode = 'GB' -%}
{%- when 'AUD' -%}{%- assign CountryCode = 'AU' -%}
{%- else -%}{%- assign CountryCode = 'US' -%}
{%- endcase -%}
<channel>
<title>{{ shop.name }} {{ collection.title | strip_html | strip_newlines | replace: '&', '&amp;' }}</title>
<link>{{ shop.url }}</link>
<description>{{ collection.description | strip_html | strip_newlines | replace: '&', '&amp;' }}</description>
{% for product in collection.products %} 
  {% for variant in product.variants %}
    {%- if variant.compare_at_price > variant.price -%}
      {%- assign OnSale = true -%}
      {%- assign Price = variant.compare_at_price -%}
      {%- assign SalePrice = variant.price -%}
        <item>
            <g:item_group_id>shopify_{{ CountryCode }}_{{ product.id }}</g:item_group_id>
            <g:id>shopify_{{ CountryCode }}_{{ product.id }}_{{ variant.id }}</g:id>
            <g:price>{{ Price | money_without_currency }} {{ shop.currency }}</g:price>
            <g:sale_price>{{ SalePrice | money_without_currency }} {{ shop.currency }}</g:sale_price>
        </item>
    {%- endif -%}
{% endfor %}
{% endfor %}
</channel>
</rss>
{% endpaginate %}

Also available on github

2. Create a new collection called “google-feed-sale-price” based on your Collection Template

  • IMPORTANT Choose xml-pricing-feed as your collection template
  • Add products to the collection (or you can create an automatic collection with Compare At Price is Greater than 1)

3. Preview the collection and copy the url.

  • Your url should look something like this: yourstoredomain.com/collections/google-feed-sale-price
  • When you preview your page, it should look like a bunch of unformatted text on your page. If you see images, then you probably skipped the first bullet point in Step 2.

Add a Supplemental Data Feed in Google Merchant Center

4. Open Merchant Center and go to
Products > Feeds > Supplemental Feeds > Add Supplemental Feed

  • Name: Sale Pricing Update
  • Feed Type: Scheduled Fetch
  • File Name: google-feed-sale-price
  • File Url: yourstoredomain.com/collections/google-feed-sale-price

Leave everything else as default values and click Continue

5. Make sure there’s a checkmark beside Content API and click Create Feed

6. You should now see your newly created feed in the Supplemental Feeds section. Click on your feed’s name and then click on Fetch Now to update pricing data immediately.

Done

It may take up to 30 minutes for your main feed to be updated. Any new sale pricing will now be uploaded once per day.

Related Reading

Categories
Digital Marketing Facebook Ads

Facebook Campaign Structure for Long-Term Success

Evergreen Campaigns

Evergreen Campaigns add some structure and sanity to your Facebook Ad management. They prevent the typical disorganized Campaign sprawl that plagues most Facebook Ads Accounts. Evergreen Campaigns encourage continuous improvement and optimization, facilitates data analysis, and lowers maintenance costs.

An Evergreen Campaign Structure doesn’t change much year over year: The Campaigns and Ad Sets are continually in use, and only the ad creative is changed.

Campaign Structure

The campaign structure is relatively simple: 3-4 primary campaigns targeting 3 main segments: Past Purchasers, Remarketing, and Prospecting.

Past PurchasersRemarketingProspecting
People who have previously purchased from you.People who have interacted with your brand via your website, social media, or otherwise, but have not purchased from you yet.People who have never purchased from you, and who have not interacted with your brand in the past 180 days.
CPA $CPA $$CPA $$$
Budget $$Budget $$$Budget $
Facebook Evergreen Campaign Structure

Audiences

Before you can create your campaigns, you will need to define some base audiences to capture purchasers and website visitors. A full description of the essential Facebook audiences that should be created is available here.

Building the Campaigns

Campaign #1: Past Purchasers

This campaign targets people who have previously purchased from you. Generally your cost per acquisition will be low, and your budget will be a function of how many customers you have.

Campaign NameBuying TypeObjective
Past PurchasersAuctionConversions

Ad Sets for Past Purchasers Campaign

At it’s most basic, the campaign contains a single Ad Set containing all your past customers:

Ad Set NameAudiences
Past Purchasers All TimePurchase 10d
Purchase 30d
Purchase 180d
Purchaser All Time

For high volume businesses that have large amount of customers, multiple Ad Sets could be create, one for each audience to have more granular control based on past purchase date. However, a single campaign targetting all past purchasers is also quite effective, trusting Facebook’s algorithm to take purchase recency into account.

Campaign #2: Remarketing

This campaign targets website visitors and people who have previously engaged with your brand on facebook, instagram, or otherwise, but who have NOT previously purchased from your business.

Your Cost per Acquisition (CPA) will be relatively low, and therefore you should manage to have a relatively large budget while maintaining a profitable CPA.

This campaign actually needs to be setup as two separate campaigns

Campaign NameBuying TypeObjective
RemarketingAuctionConversions
Dynamic RemarketingAuctionCatalog Sales
The Remarketing campaign needs to be split into two: one for regular ads, and another for dynamic product ads.

Ad Sets for Remarketing Campaigns

Ad it’s most basic, the Remarketing Campaign contains only two Ad Sets targeting visitors who engaged with your brand up to 30 days ago, and another for people who engaged with your brand up to 180 days ago (the Facebook maximum)

Ad Set NameAudiencesExclude
Remarketing 30dAdd to Cart 30d
Visitors Top 25% 30d
FB Engagement 30d
IG Engagement 30d
Purchase 30d
Remarketing 180dAdd to Cart 180d
Visitors Top 25% 180d
FB Engagement 180d
IG Engagement 180d
Purchase 180d
Add to Cart 30d
Visitors Top 25% 30d
FB Engagement 30d
IG Engagement 30d

For higher volume sites, you can consider adding more granular Ad Sets for 10, 60, 90 day etc… remarketing audiences.

Ad Sets for Dynamic Remarketing

Ad Set NameAudiences
Product View 30dRetarget Ads:
Viewed or Added to Cart
but not Purchased: 30d
Product View 180dRetarget Ads:
Viewed or Added to Cart
but not Purchased: 180d
Cart Abandon 30dCart Abandon 30d
Cart Abandon 180dCart Abandon 180d

For high-volume sites, or for periods of high sales such as Black Friday, you can also consider creating 10, 4, or even 1 day Ad Sets.

Campaign #3: Prospecting

This campaign will target “brand unaware” customers. People that have never purchased from you, and that have not interacted with your brand or site in at least 180 days.

This campaign will feed your Remarketing campaigns. You can expect your Cost per Acquisition (CPA) to be relatively high and your budgets will need to be relatively low to remain profitable. But the more you can manage to spend here, the more you will be able to spend on Remarketing.

Campaign NameBuying TypeObjective
Prospectiv=ngAuctionConversions

Ad Sets for Prospecting Campaign

At it’s most basic, the prospecting Campaign should target a 1% look-a-like audience (based on the Purchase pixel event).

More advanced campaigns can also target 2%-10% look-a-like audiences, or custom interest based audiences. But it is important to always exclude your Past Purchasers and Remarketing audiences so that there is no overlap with your campaigns.

Ad Set NameAudiencesExclude
1% Look-a-like Purchase1% Look-a-like PurchasePurchase All Time
Purchase 180d
Add to Cart 180d
Site Visitors Top 25% 180d
FB Engagement 180d
IG Engagement 180d

The Big Picture

Once all the above is setup, your Campaign and Ad Sets should look something like this:

Facebook Ads Evergreen Campaign Structure
Facebook Ads Evergreen Campaign Structure

All that remains now is to create ads or duplicate your posts into these campaigns. But that is a topic for another day.

Related Reading

Categories
Digital Marketing Facebook Ads

Essential Facebook Audiences

Below is a list of the Essential Facebook Audiences the every e-commerce site should create in their Facebook Ads Account. Even if you don’t plan on using them right away, creating them now will ensure that you can serve ads to these users in the future.

Past Purchasers

Past Purchasers audiences will be used to target users that have previously purchased from you. There are 4 audiences with varying time periods, to allow you to target your past purchasers by how recently they purchased from you.

To create these go to
Audiences > Create Audience > Custom Audience

Audience NameSourcePixel Criteria
Purchase: 10 dayWebsitePurchase: 10 days
Purchase: 30 dayWebsitePurchase: 30 days
Purchase: 180 dayWebsitePurchase: 180 days
Purchase: All TimeCustomer ListCustomer list upload*
* The “Purchase: All Time” audience will need to be updated every 180 days.

Visitors and Social Fans

These audiences include website visitors, cart abandoners, and people who have engaged with your content on Facebook and Instagram. These are all people that are “brand aware” and are some of the lowest hanging fruit in terms of generating sales.

To create these audiences go to
Audiences > Create Audience > Custom Audience

Audience NameSourcePixel Criteria
Add to Cart: 1 dayWebsiteAddToCart: 1 day
Add to Cart: 4 dayWebsiteAddToCart: 4 days
Add to Cart: 30 dayWebsiteAddToCart: 30 days
Add to Cart: 180 dayWebsiteAddToCart: 180 days
Site Visitors: Top 25%: 10 dayWebsiteVisitors by Time spent:
Top 25%: 10 days
Site Visitors: Top 25%: 30 dayWebsiteVisitors by Time spent:
Top 25%: 30 days
Site Visitors: Top 25%: 180 dayWebsiteVisitors by Time spent:
Top 25%: 180 days
FB Engagement: 10 dayFacebookEveryone who engaged
with your page: 10d
FB Engagement: 30 dayFacebookEveryone who engaged
with your page: 30d
FB Engagement: 180 dayFacebookEveryone who engaged
with your page: 180d
IG Engagement: 10 dayInstagramEveryone who engaged
with your business: 10d
IG Engagement: 30 dayInstagramEveryone who engaged
with your business: 30d
IG Engagement: 180 dayInstagramEveryone who engaged
with your business: 180d

Lookalike Audiences

Lookalike audiences are a good base to use for new customer prospecting. If you target multiple countries, you will need to create a separate set of these for each country.

To create these audiences go to
Audiences > Create Audience > Lookalike Audience

Lookalike SourceEventNumber of
Audiences
Audience Markers
Facebook PixelPurchase40%, 1%, 2%, 5%, 10%
Choose 4 audiences, and set markers at 0%, 1%, 2%, 5%, and 10%

Next: Campaigns

Once you’ve created your audiences, the next step is to create a Facebook Evergreen Campaign Structure properly segmented into Past Purchasers, Remarketing, and New Customer Prospecting.

Related Posts