Skip to content
← Selected work

02 / 06

AMPscript & Personalization

Writing AMPscript for personalized subject lines and conditional content, and setting up A/B tests.

Company
Gap Inc
Role
Email Developer
Years
2019–23

The job

Customers got different content depending on brand, loyalty tier and region. The same template had to handle every version.

What I did

  1. Wrote AMPscript for personalized subject lines and conditional content
  2. Set up A/B tests on subject lines, from names, images and Movable Ink content
  3. Used data extension fields to drive dynamic content
  4. Worked with SQL queries from the data team for audience segmentation
  5. Checked every version on test sends before handoff

Personalization, up close

One template served many customers. AMPscript read each customer’s data at send time and decided what they saw: their name, their balance, their department and their language.

LookupPull data from another table

Values like saved cart items came from a separate data extension, matched on the customer’s key.

IF / ELSEIFShow content by segment

A shopper’s department (women, men, kids, baby) decided which version of the email they got.

See it working

An A/B test rebuilt from the original Gap Factory assets: the same offer with two subject lines, two preheaders and two hero images. Version B puts the customer’s first name in the subject line, with a fallback when it’s missing.

How I built it

  1. Wrote subject lines with a fallback when a first name was missing
  2. Used IF / ELSEIF to switch content by segment and department
  3. Used Lookup to pull values from other data extensions
  4. Split audiences for tests, such as 33/33/34 across three versions
  5. Claimed unique promo codes per customer with ClaimRow

A line from the code

%%[ if @adhoc5 == "WMN" or @adhoc5 == "MAT" then
      set @adhoc_evo_append = "WOMEN"
    elseif @adhoc5 == "MEN" then
      set @adhoc_evo_append = "MEN"
    else
      set @adhoc_evo_append = "ROF"
    endif ]%%

A shop-by-size email picked its version from the shopper’s department. Anyone outside the main groups got the general version.

How I checked it

  1. Built a test record for every branch, including missing data
  2. Previewed each version as a test subscriber before handoff
  3. Checked test splits added up and each version reached its group

How it helped

One template could cover many customer versions, which cut down on separate builds and kept content consistent.

Skills used

  • AMPscript
  • Personalization
  • A/B testing
  • Data extensions
  • SQL
  • Dynamic content

See the work