# Should we install Croct through Google Tag Manager or the SDK directly?

Asked by Selin Acar on 2024-06-25. Tags: javascript, gtm, setup.

I sit between marketing and engineering, and I own our GTM container. We are
setting up Croct and I want to make the right call before asking devs for sprint
time.

What does the GTM route actually cover? We need two things: event tracking from
our existing data layer, and the ability to change content on the page for
different audiences. If the GTM tag handles both, great, I can ship it myself.
If it only covers tracking, I would rather know that now than find out after
the container is live.

## 2 answers

### Answer from Priya Raghavan (2024-06-25)

They cover different halves, so the answer depends on which half you need.

The GTM integration is a single Croct tag that listens to Google's recommended
events in the data layer (e-commerce, lead gen, engagement events) and maps
them to Croct events. It is an ingestion mechanism: data flows in, profiles and
audiences get built. Conversion-indicating events like purchase and sign-up are
recorded as conversions automatically, which is what your experiments measure
against.

What the tag does not do is render content. Changing what appears on the page
requires code that fetches slot content and puts it in the DOM, which means the
SDK (React, Next.js, Vue, plain JS) or at minimum the script tag plus
`croct.fetch`.

So for your two requirements: GTM gets you tracking today with zero dev time,
but the content half needs an engineering ticket regardless.

### Answer from Marcus W (2024-06-26)

Adding a practical note from a team that went through this exact decision: run
both. It is a common setup, not either/or.

We kept the GTM tag as the event pipeline because our data layer was already
mature, and had the devs install the JavaScript SDK only for the pages with
personalized slots. The two do not conflict, events from the tag and content
fetches from the SDK land in the same workspace and the same profiles.

One thing that helped the conversation with engineering: the SDK footprint for
content-only usage is small since the tag keeps carrying the tracking load. The
dev ticket ended up being about wiring two slots, not building a tracking plan.
