Categories
Wordpress

Woocommerce Algolia: How To Add Price (and other fields) to AutoComplete DropDown

I have often wondered how we can add Price (and possibly other product meta data like Average Rating, etc) to the drop down for Algolia Search As You Type solution. Since the Algolia plugin is not supported by Algolia anymore, this was not easy to find. In this post

Background

This post assumes that you have Algolia search working on your WooCommerce website. This post also assumes that you have your main search bar controlled by Algolia for populating the search results.

Steps

Let us get to the code.

  1. Essentially, I took the information provided at the 2 links below

2. VERY IMPORTANT: After adding the code and clearing caches, make sure to click on “Re-Index” and “Push Settings” for the Product Index (found under WordPress Admin Dashboard->Algolia->AutoComplete). Wait a few minutes for the Products to re-index with Algolia and then try your change.

Code

The code is what you really came here for, so without further ado, I present to you the code that I added to get this working. The gist below shows changes to 2 files:

  • wp-content/themes/child-theme/algolia/autocomplete.php – You have to copy this over from the algolia plugin directory and then make changes
  • wp-content/themes/child-theme/functions.php – You should be familiar with this file. Simply add this snippet to the bottom of your existing functions.php file

https://gist.github.com/amitramani/39923b821fc4aa6d9c8e2fc531ee536b

Even though this example specifically deals with the “Price” field, the same logic can be used for adding any other woocommerce product meta data. My next step was going to be to add Average Rating to the Autocomplete results drop down.

Conclusion

If you have found this useful, leave a comment. This is first of a series of posts related to my coding adventures with customizing Algolia on your website. I truly believe it is a fantastic search solution. We are thankful to the WebDevStudios team for taking it over. Please provide your feedback/questions and I will try my best to respond.

Categories
Wordpress

Woocommerce Visual Product Configurator CDN Conflict

The Visual Product Configurator Plugin allows you to offer fully customized products to your customers. Think earphones whose earpieces can be colored, think T-Shirts with different colors, think Sunglasses etc.

The plugin works quite well on its own when I first tested it on localhost. On the Admin side, you build Product Builder Configurators. These configurators contain several different options for the various components of the product. On the front end, the user selects from the “swatches” and their custom creations come to life.

It all functions well without a CDN, Once the CDN is enabled, the plugin’s functionality breaks. Note that the error occurs when the user attempts to “Add To Cart” their customized product.

JS Error

The JS Error as shown in the Console is:

Uncaught (in promise) DOMException: Failed to execute ‘toDataURL’ on ‘HTMLCanvasElement’: Tainted canvases may not be exported.
at https://sitepath/wp-content/plugins/Visual-products-configurator/public/js/vpc-public.js?ver=5.6.6:261:30
at new Promise ()
at getCanvasBase64image (https://sitepath/wp-content/plugins/Visual-products-configurator/public/js/vpc-public.js?ver=5.6.6:259:10)
at https://sitepath/wp-content/plugins/Visual-products-configurator/public/js/vpc-public.js?ver=5.6.6:366:31

Notably, once the CDN is disabled, this error disappears. The “Add To Cart” functionality is restored.

Response from Plugin Authors

I have reached out to the plugin author. Their response is that they are aware of this issue and are actively working on it. They expect to fix it in the next release of the plugin, but there is no timeline for the fixed version.

If anyone else has had a similar issue, can you please chime in?

Categories
Wordpress

[SOLVED] GSC reports “availability” error for Products Schema when Product Feed Pro for WooCommerce is enabled

A few month ago, I started a Google Shopping Campaign in Adwords. For this kind of campaign, you need to have a Google Product Feed setup (via Google Merchant Center). The products from your catalog are compiled into an XML feed (or CSV or other formats) that are then uploaded automatically into your Google Merchant Center Acount.

Google Adwords-Google Merchant Center-Google Search Console

Long story short, the products are then shown in Google Search Console as well. Here is where the smarts come in: GSC will actually report to you all details about your products. On a very high level, it tells you how many products are active etc. It also shows you which products are NOT being shown on your ads because of some missing/erroneous fields.

For me, a lot of the product were showing that the “availability” field was missing. This field tells Google if the product is In Stock/Out Of Stock. By default, if something is Out Of Stock, it will not be shown.

Digging deeper, I found that this was happening as a direct consequence of some specialized code in the Product Feed Pro plugin of Woocommerce. This is an excellent plugin. There is not another plugin that is as powerful and fast for producing Product Feeds.

There is a code conflict between WooCommerce and Product Feed Pro plugin that causes this error. Read this post related to this conflict.

How Did I Solve This Issue?

A specific filter hook from woocommerce called the ” woocommerce_structured_data_product_offer ” that allows you to overwrite the “availability” filter.

I just removed the filter that was being used by the Product Feed Pro plugin. So, the Product Feed Pro plugin code that was omitting the “availability” field will not longer be executing.

remove_filter( 'woocommerce_structured_data_product_offer', 'woosea_product_delete_meta_price' );

Check the plugin for updates

The author of the “Product Feed Pro” plugin may very well have updated the code to address this issue. Please note that my one liner fix is just that, a “fix”. It is recommended that you check the latest version of the plugin.

Categories
Wordpress

Adwords Script for generating a Negative Keywords List

During the maintenance of my Shopping campaign in adwords, I realized I was spending a lot of time just weeding out the search terms that were not producing any conversions. These useless terms were dragging down the overall campaign performance. As a result, the campaign budget was being exhausted earlier.

Given my new found zeal for Adwords Scripts, I embarked on a journey to automate the process. Below the script is presented. I hope you will find it useful.

Script Variables

    null
  • IMPRESSIONS_THRESHOLD = 300;
  • CAMPAIGN_NAME = “Shopping”;
  • NEGATIVE_KW_LIST = “Automated-NegativeKWL-Shopping”;
  • AVERAGE_CPC_THRESHOLD = 1; // $1
  • CTR_THRESHOLD = 8; // 0.5%
  • COST_THRESHOLD = 1; // $4
  • CONVERSIONS_THRESHOLD = 1; // 1
  • MICRO_AMOUNT_MULTIPLIER = 1;
  • SPREADSHEET_URL = ‘https://docs.google.com/spreadsheets/d/1rLuHlBlc5IHo_hT8TZWCFUTz8fLO1CGHfcdSvXyiYwI/’;
  • SHEET_NAME = ‘NegativeKWListShopping’;

You can change these variables to tweak your performance criteria. For example, if you want to exclude Search Terms with less than 2 conversions and Impressions atleast 600, just change the corresponding parameters. In this case, you will set the CONVERSIONS_THRESHOLD to 2 and IMPRESSIONS_THRESHOLD

Adwords Script

Here is the script. Simply copy and paste into your Adwords Scripts.

Conclusion

I hope that someone finds this script useful. It has definitely been of value to me in making my workflow efficiently. In my case, this was specifically applied to the shopping campaign, particularly because there are no set keywords in Shopping ads. However, the same concept can be applied to any other Search campaign. Let me know your thoughts. This is my first attempt at publishing an Adwords script.

Categories
Wordpress

Notes from Google Adwords Workshop at PubCon Florida 2019

In May of this year, I attended my first Pubcon. Specifically, I attended the Adwords workshop at Pubcon. Below are my thoughts from attending this event. Sorry, if they are a bit random, but its the best I could do while trying to collect and store all the instructions.

Ad Testing Ideas

Want to know the best ad for a targeted audience? Use Single-Ad Group Testing.

Segment your Ads: Brand vs Awareness.

Learn how to use Pivot Tables. (youtube videos on Pivot tables). It is an essential skill.

CTR is not a good metric for Ad Testing. It ignores the Bounce Rate entirely.

Favorite Metrics : Conversion Per Impression (CPI) or Revenue Per Impression (RPI).

Use Ad Extensions.

Keyword Changes

Semantic vs Syntactic Match Type

Phrase Match is a syntactic match type

Exact Match is a semantic match type.

Download your query data before 9/6 and 1/1. Do a Pivot Table, Match Type. Compare the exact match: did it improve or same or get worse?

Broad Match Type is a Semantic Match Type. Suggestion is to use a Broad Match Modifier like “+word” so the ad triggers only when “word” is contained in the search query.

Negative Keyword

Negative keywords do not match plurals. If the negative keyword is in anywhere in the search term, ad will not show.

Phrase Match Type vs Broad Match Type vs Exact Match for Negative Keywords.

Use Filters extensively

Cost $25.00; Coversions < 1, Added/Excluded – None – Terms that are not-converting and need to be removed.

CPA < Target CPA, Conversions > 3, Added/Excluded = None – > Make these keywords.

Tools To Use

  • Adwords Scripts – This is one of the most useful takeaways from the workshop. Since I attended the workshop, I have worked on improving my scripting skills. This has immense value at cutting down the manual effort and time needed for day-to-day maintenance.
  • Excel (Pivot Tables help you visualize the data and turn it into insight)
  • Adword N-Gram Analysis Tool (this is something new that I need to learn)

Expand Query Ads

Dynamic Search Ads – You do not write headlines, you tell Google to generate the headline based on the content of your website. Basically, match search keywords to landing pages automatically. DSA’s are useful for finding new search terms. It is dependent on good organic schema markup. Website structure will be an important factor for these DSA ads. You can also make negative dynamic targets.

Then, look at the Search Terms that are converting with DSA’s.

What’s New in Google Ads

  • Average Position in deprecated. It will disappear in September.
  • New Top IS Metrics: Abs Top Achieves, Top IS Achieved, Top IS Missed & Abs Top Missed. Conversion Rate is generally steady independent of position. CTR is higher for higher positions.
  • Advertisers should use conversion based bidding. For brand terms, you want to be in absolute top position.

Closed Variants

Closed variants work across all Match Types (Broad, Modified Broad, Exact Match, Phrase Match.

Responsive Search Ads

You should use a lot of variations. Mix the length of the headlines. RSA Ads: You give google headlines and descriptions, google will create ads.

Segment your analysis. Use Fred’s script to get the data. If the top performing ads are different for computer vs mobile vs tablet, then you should split the ads across different devices.

Use Landing Page screen to see which pages take longer to load. Work on optimizing page load time to increase conversions. Time To Load > 3 seconds is considered slow.

Uee Promotion Extensions to distinguish your ad from the competition.

Look at Giant Carousel Ads.

Look at ConversionLagBucket Added to Reports. Ignore the last 5 days of data because the conversion numbers have not been processed, if the average conversion lag is 5 to 7 days.

Google Shopping Campaigns

  • Use of smart shopping campaign is encouraged.
  • Item ID is used for correlating Quality Score. Try changing the product ID for improving CTR.
  • Recommended to place each product in its own product group. (think of it as Ad Group for non-ecommerce applications).
  • Single Product Ad Groups
  • SPAG – Each ad group has exactly one product group.
  • You can split the products by Product Category or Brand.