Alternate CTA button text

In the brief, Louise said she wants to test the CTA button copy. To allow her to do this, Lori added a text field labelled A/B test alternate link text” to the action link block in the page body matrix field. Lori also edited the template to use this new field.

For the alternate link text to work, you need to add an experiment with the following settings in the staging site’s Craft control panel:

  • Name: CTA link text
  • Handle: ctaLinkText
  • Variants (weighted equally at 50% each):
    1. Original (original)
    2. Alternative (alternative)
  • Starts at: Immediately
  • Ends at: 30 days in the future

Test the variant by adding “?optimum=original” or “?optimum=alternative” to the page’s URL. For example: https://staging.filmtvcharity.org.uk/documentation/standard-page-pattern-library?optimum=original

Analytics

Once an experiment is set, the data is automatically sent to Google Analytics 4 (GA4) as a custom dimension. The plugin’s documentation includes the steps to set a custom dimension in GA4.

Search engines

For search engines like Google Search, only the original version of the page will be indexed as the plugin uses cookies to serve the other versions. However, don’t run the experiment for longer than necessary, as Google may interpret this as an attempt to deceive search engines and take action accordingly. Here’s Google’s guide to minimising A/B testing’s impact in Google Search.