> For the complete documentation index, see [llms.txt](https://docs.edgetag.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgetag.io/onboarding/e-commerce/scaling-playbook/edgetag-gtm-implementation-guide-for-marketing-teams/phase-2-gtm-setup-weeks-2-3.md).

# Phase 2: GTM Setup (Weeks 2-3)

This section is where GTM gets configured. We'll keep it marketer-friendly—your dev/analytics team will handle the actual implementation.

### 6.1 Initialize EdgeTag

Your IT team creates the foundational tag that loads EdgeTag on every page.

**What this does:** Activates EdgeTag on your website so conversion tracking can begin.

**Key thing to know:** This tag must fire **first**, before any other EdgeTag tags. It's the foundation.

**Estimated time:** 30 minutes setup + 30 minutes testing

#### **For Your Dev/Analytics Team**

Here's what needs to happen:

1. Create a "EdgeTag - Init" tag in GTM
2. Configure it to fire on all pages
3. Set tag sequencing so it fires before all other EdgeTag tags
4. Add your EdgeTag endpoint URL
5. Test in GTM Preview mode

{% hint style="info" %}
**Your role as a marketer:** Confirm the EdgeTag endpoint URL is correct. Ask your EdgeTag contact for your unique EdgeTag URL, then verify it in the init tag before testing starts.
{% endhint %}

### 6.2 Set Up Conversion Event Tracking

Using your conversion roadmap from Phase 1, create GTM tags for each event.

#### **Purchase Event (Most Important)**

This tag fires when a customer completes a purchase.

**What it captures:**

* Order ID
* Total revenue
* Products purchased (name, category, price)
* Currency
* Customer email

**Why it matters:** This is your primary optimization signal. Ad platforms use this to:

* Optimize campaign budgets to higher-converting audiences
* Calculate ROAS
* Build lookalike audiences from your best customers

**For Your Dev/Analytics Team:**

Create a "EdgeTag - Purchase" tag that pulls purchase data from your order confirmation page and sends it to EdgeTag. Test with a real test purchase or staging environment.

#### **Add to Cart Event**

Fires when a product is added to cart.

**Why it matters:** Early funnel signal. Helps platforms optimize before you have complete purchase data.

#### **Product View Event**

Fires when a user views a product page.

**Why it matters:** Intent signal. "This customer looked at our premium product" = good targeting audience.

#### **Checkout Event**

Fires when checkout process begins.

**Why it matters:** Measures abandonment, helps identify users likely to purchase soon.

{% hint style="info" %}
**Marketing insight:** If checkout abandonment is high, you have a funnel leak. Use this data to test checkout changes like fewer form fields or stronger trust signals.
{% endhint %}

### 6.3 Set Up Customer Data Capture

Your team creates tags to send customer information to EdgeTag whenever someone signs up, logs in, or completes checkout.

#### **What Your Team Will Set Up**

**Checkout Data Tag** — Captures:

* Email
* Name
* Phone
* Address (city, state, country)

**Fires when:** User reaches checkout page

**Why:** Ad platforms match this data to their user databases. More accurate targeting = lower CAC.

**Form/Signup Data Tag** — Captures:

* Email
* Name
* Phone (if collected)

**Fires when:** Form is submitted

**Why:** Captures identified users earlier in the funnel. This improves audience matching before checkout.

**Normalize before sending:**

* Lowercase and trim email
* Format phone in E.164 when available
* Trim whitespace from names and standardize country and state values

**How to validate:**

1. Submit a real or test form in GTM Preview mode
2. Confirm the form tag fires and expected fields are present
3. Check Real Time Logger for the same user data
4. If needed, confirm the event reaches platform diagnostics or test views after processing


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.edgetag.io/onboarding/e-commerce/scaling-playbook/edgetag-gtm-implementation-guide-for-marketing-teams/phase-2-gtm-setup-weeks-2-3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
