Skip to content
Tutorials Center
My learning

Topics

Lesson 18 of 36 ยท CRM Concepts

Marketing Automation and Segmentation

Learn the marketing side of CRM: segmenting contacts, running campaigns and nurture journeys, consent and opt-out rules, A/B tests, campaign ROI and attribution models, with runnable examples.

Marketing's job in a CRM is to bring the right message to the right people at the right time, then show which efforts earned revenue. The CRM supplies the data (who people are, what they did, what they bought); marketing automation uses it to run campaigns without a person pressing send for every email.

This lesson covers segmentation, campaigns and nurture journeys, consent, testing and attribution. Real marketing tools are not available on this site, so Python stands in for the logic.

Segmentation

A segment is a group of contacts that share traits, so a message can fit them better than a mass mailing. Criteria include:

  • Demographic / firmographic: role, industry, company size, country.
  • Behavioural: pages visited, downloads, last purchase, product usage.
  • Lifecycle stage: lead, customer, churn risk.
  • Value: lifetime spend, plan tier.

Segments can be static (a fixed list) or dynamic (a saved rule that re-evaluates, so people enter and leave automatically).

Python A dynamic segment as a rule

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Mia matches every business rule but is excluded because she has not consented. That brings us to a crucial topic.

Marketing laws (GDPR and ePrivacy in Europe, CAN-SPAM in the United States, CASL in Canada, others elsewhere) require lawful grounds, usually consent, for marketing messages, honest sender details and a working opt-out. A CRM should store, per contact and channel:

  • consent status and date and source (which form, which wording),
  • opt-out or suppression flags that no campaign can override,
  • the data-processing purpose.

Treat these rules as part of the design, and ask your legal advisers for your regions, because they differ.

Campaigns

A campaign groups marketing activities toward a goal (launch a product, fill a webinar). In the CRM it has a budget, dates, a channel mix, members with a status (sent, opened, responded) and links to the leads and opportunities it influenced. Typical channels are email, ads, events, content and social.

Campaign structure

Goal Leads, signups, sales
Segment Who receives it
Message Content and channel
Measure Opens, leads, revenue

Define success before sending

1 / 2

Nurture journeys

Nurturing warms up leads who are not ready to buy through a sequence of helpful messages. A journey is a flow with triggers, waits, conditions and actions, for example:

flowchart TD
  A["Downloads guide"] --> B["Send welcome email"]
  B --> C["Wait 3 days"]
  C --> D{"Opened email?"}
  D -- Yes --> E["Send case study"]
  D -- No --> F["Resend with new subject"]
  E --> G{"Visited pricing?"}
  G -- Yes --> H["Alert sales"]
  G -- No --> I["Continue nurture"]

A small journey: behaviour decides the next message and when sales is alerted.

Python Choosing the next step in a journey

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Note the order: the unsubscribe check comes first, so no other rule can override it.

Testing and measurement

Common email metrics are delivery rate, open rate, click-through rate (CTR), conversion rate, unsubscribe rate and bounce rate. Open rates have become less reliable as mail clients preload images, so clicks and downstream conversions are better signals.

An A/B test sends two variants to random halves and checks whether the difference is likely real.

Python Comparing two subject lines

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Campaign ROI and attribution

ROI = (revenue attributed - cost) / cost. The hard part is attribution: a customer may have clicked an ad, read an email, attended a webinar and then spoken to sales. Models include:

  • First touch: all credit to the first interaction.
  • Last touch: all credit to the final one.
  • Linear: equal credit across touches.
  • Position-based: more credit to first and last.
  • Time decay: more credit to recent touches.
Python Attribution models compared

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

No model is "true"; pick one, apply it consistently and combine it with common sense.

Connecting marketing to sales

Marketing hands over MQLs to sales (lead management), and sales feedback improves targeting. The shared metric is pipeline and revenue sourced or influenced, not just clicks.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A dynamic segment

    Dynamic segments are saved rules that update as the data changes.
  2. 2. Why must the unsubscribe check run before other journey rules?

    Opt-outs must override every campaign rule.
  3. 3. Under last-touch attribution, who gets the credit?

    Last touch assigns all credit to the last interaction.
  4. 4. Why are click and conversion rates preferred over open rates?

    Privacy features and image preloading make open tracking unreliable.

Summary

  • Segments (static or dynamic) target messages; consent and opt-outs must be stored and respected.
  • Campaigns link goals, segments, messages and results; nurture journeys react to behaviour.
  • Test with A/B experiments and measure clicks and conversions, not just opens.
  • Attribution models spread credit across touches; choose one and apply it consistently.

Next: The ERP and CRM Implementation Lifecycle