Skip to content
Skills Library
Programming · Tool integration

walkeros-mapping-configuration

/walkeros-mapping-configuration

Use when configuring walkerOS event mappings for specific use cases. Provides recipes for GA4, Meta, custom APIs, and common transformation patterns.

Repository
walkerOS ↗
Licence
MIT
Last repository change
22.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when configuring walkerOS event mappings for specific use cases. Provides recipes for GA4, Meta, custom APIs, and common transformation patterns.

Original author description

Use when configuring walkerOS event mappings for specific use cases. Provides recipes for GA4, Meta, custom APIs, and common transformation patterns.

How it works

  1. Prerequisites
  2. Quick Reference
  3. Common Recipes
  4. Source-Side Mapping
  5. Debugging Tips
  6. Related Skills
Original SKILL.md headings · 324 lines, 891 words
SKILL.md preview
---
name: walkeros-mapping-configuration
description:
  Use when configuring walkerOS event mappings for specific use cases. Provides
  recipes for GA4, Meta, custom APIs, and common transformation patterns.
---

# Mapping Configuration Recipes

## Prerequisites

Read [understanding-mapping](../walkeros-understanding-mapping/SKILL.md) first
for core concepts.

## Quick Reference

| I want to...                   | Use this pattern                                      |
| ------------------------------ | ----------------------------------------------------- |
| Rename event                   | `{ name: 'new_name' }`                                |
| Extract nested value           | `'data.nested.value'`                                 |
| Set static value               | `{ value: 'USD' }`                                    |
| Transform value                | `{ fn: (e) => transform(e) }`                         |
| Build object                   | `{ map: { key: 'source' } }`                          |
| Process array                  | `{ loop: ['source', { map: {...} }] }`                |
| Gate by consent                | `{ key: 'data.email', consent: { marketing: true } }` |
| First defined value (fallback) | `[{ key: 'data.sku' }, { key: 'data.id' }]`           |
| Add a field to a default rule  | `{ extend: { data: { map: { x: 'path' } } } }`        |
| Drop a field from output       | `{ remove: ['field.path'] }`                          |

## Common Recipes

### GA4 / gtag

**Product view → view_item:**

```typescript
product: {
  view: {
    name: 'view_item',
    data: {
      map: {
        currency: { value: 'USD' },
        value: 'data.price',
        items: {
          loop: [
            'nested',
            {
              map: {
                item_id: 'data.id',
                item_name: 'data.name',
                item_category: 'data.category',
                price: 'data.price',
                quantity: { value: 1 },
              },
            },
          ],
        },
      },
    },
  },
}
```

**Order complete → purchase:**

```typescript
order: {
  complete: {
    name: 'purchase',
    data: {
      map: {
        transaction_id: 'data.orderId',
        value: 'data.value',
        currency: 'data.currency',
        items: {
          loop: [
            'nested',
            {
              map: {
                item_id: 'data.id',
                item_name: 'data.name',
                price: 'data.price',
                quantity: 'data.quantity',
              },
            },
          ],
        },
      },
    },
  },
}
```

### Meta Pixel

**Product view → ViewContent:**

```typescript
product: {
  view: {
    name: 'ViewContent',
    data: {
      map: {
        content_ids: { fn: (e) => [e.data.id] },
        content_type: { value: 'product' },
        content_name: 'data.name',
        value: 'data.price',
        currency: { value: 'USD' },
      },
    },
  },
}
```

**Order complete → Purchase:**

```typescript
order: {
  complete: {
    name: 'Purchase',
    data: {
      map: {
        content_ids: { fn: (e) => e.nested?.map((n) => n.data.id) ?? [] },
        content_type: { value: 'product' },
        value: 'data.value',
        currency: 'data.currency',
        num_items: { fn: (e) => e.nested?.length ?? 0 },
      },
    },
  },
}
```

### Custom API Destination

**Transform to REST API format:**

```typescript
'*': {
  '*': {
    name: { fn: (e) => `${e.entity}_${e.action}` }, // page_view
    data: {
      map: {
        eventName: 'name',
        eventData: 'data',
        userId: 'user.id',
        sessionId: 'user.session',
        timestamp: 'timestamp',
        metadata: {
          map: {
            consent: 'consent',
            globals: 'globals',
          },
        },
      },
    },
  },
}
```

### Conditional Mapping

**Different mapping based on event data:**

```typescript
order: {
  complete: [
    // High-value orders get extra tracking
    {
      condition: (e) => (e.data?.value ?? 0) > 500,
      name: 'high_value_purchase',
      data: {
        map: {
          value: 'data.value',
          priority: { value: 'high' },
          notify: { value: true },
        },
      },
    },
    // Standard orders
    {
      name: 'purchase',
      data: { map: { value: 'data.value' } },
    },
  ],
}
```

### Patching Package-Shipped Rules (`extend` / `remove`)

Some packages (such as `@walkeros/transformer-ga4`) ship default mapping rules.
Normally a user rule at the same key replaces the default in full. Use `extend`
or `remove` to patch instead.

Two layers, two keywords:

- **`extend`** runs at init (config layer): deep-merges a partial rule onto the
  shipped default. A `null` value clears an inherited field.
- **`remove`** runs after evaluation (output layer): strips dotted paths from
  the final data payload. Applied last, always wins.

A rule with neither keyword keeps the existing replace behavior.

```json
{
  "purchase": {
    "extend": {
      "data": { "map": { "affiliation": "params.ep.affiliation" } }
    },
    "remove": ["currency"]
  }
}
```

This keeps all fields the package ships for `purchase`, adds `affiliation`, and
strips `currency` from the output.

For the full reference and the two-layer model, see
[Mapping.Rule docs](/docs/mapping/rule#patching-package-shipped-rules).

### Value[] Fallback Chains

At any value position, an array of values is a fallback chain: the first entry
that resolves to a defined value wins.

```json
{
  "item_id": [
    { "key": "data.sku" },
    { "key": "data.id" },
    { "value": "unknown" }
  ]
}
```

Use this to try multiple source fields before falling back to a constant.

### Consent-Gated Fields

**Only include PII if consent granted:**

```typescript
user: {
  login: {
    name: 'login',
    data: {
      map: {
        method: 'data.method',
        // Only include email if marketing consent
        email: {
          key: 'user.email',
          consent: { marketing: true },
        },
        // Only include user ID if functional consent
        userId: {
          key: 'user.id',
          consent: { functional: true },
        },
      },
    },
  },
}
```

### Wildcard Patterns

**Catch-all for unmatched events:**

```typescript
// Any product action
product: {
  '*': {
    name: { fn: (e) => `product_${e.action}` },
    data: 'data',
  },
}

// Any click on any entity
'*': {
  click: {
    name: 'element_click',
    data: {
      map: {
        element_type: 'entity',
        element_id: 'data.id',
      },
    },
  },
}
```

## Source-Side Mapping

**Transform HTTP input to walkerOS event:**

```typescript
// In source config
{
  mapping: {
    // Map incoming field names to walkerOS structure
    name: { fn: (input) => `${input.entity} ${input.action}` },
    data: 'payload',
    user: {
      map: {
        id: 'userId',
        session: 'sessionId',
      },
    },
  },
}
```

## Debugging Tips

1. **Event not mapping?** Check entity/action match exactly (case-sensitive)
2. **Data missing?** Verify source path exists: `'data.nested.field'`
3. **Function errors?** Add null checks: `e.data?.price ?? 0`
4. **Array empty?** Confirm `nested` array exists and has items

## Related Skills

- [walkeros-understanding-mapping](../walkeros-understanding-mapping/SKILL.md) -
  Core mapping concepts

**Reference:**

- [packages/core/src/mapping.ts](../../packages/core/src/mapping.ts) -
  Implementation
- [apps/quickstart/src/](../../apps/quickstart/src/) - Validated examples

Versions

The database has no other skills named walkeros-mapping-configuration.

Database snapshot: 13.11.2026 · package version db4654838a6d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100walkeros-using-transformer-ga4
    Use when wiring `@walkeros/transformer-ga4` into a server flow, overriding default GA4 event mappings, dropping events, adding custom event keys, or troubleshooting GA4 Measurement Protocol decoding. Covers the `before`-chain wiring contract, configuration recipes, and per-field…
  • 95walkeros-understanding-mapping
    Use when transforming walkerOS events in the flow (source→collector or collector→destination), configuring data/map/loop/set/condition/policy, or using $code: syntax in JSON configs.
  • 100unit-test-mapper-converter
    Provides patterns for unit testing mappers, converters, and bean mappings. Validates entity-to-DTO and model transformation logic in isolation. Generates executable mapping tests with MapStruct and custom converter test coverage. Use when writing mapping tests, converter tests,…
  • 100configurator-recipes
    Pre-built store configuration templates for common business types. Use whenever user asks for templates, examples, starting points, or mentions fashion/electronics/subscription store setup. Not for custom product type design (use product-modeling).
  • 100writing-mappings
    Write field mappings and transforms in Celigo integrations. Covers Mapper 2.0 (imports), Transformation 2.0 (exports), lookups, response mapping, and Mapper 1.0 (NetSuite DA/Salesforce). Use when editing mappings[], transform{}, responseMapping, or lookup configurations.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.