Most affiliate pixels follow a straightforward pattern: fire a tag on the confirmation page, pass the order value and transaction ID, done. Rakuten is more involved than that. The pixel relies on a specific set of variables being correctly defined and available at the point of firing — and if any one of them is missing, wrong, or unavailable at the right moment, the conversion either doesn't register in Rakuten's reporting or registers incorrectly.
The problem is that most of these failures are silent. GTM shows the tag fired. The network request goes out. GA4 records the purchase event. Everything looks correct — until you check Rakuten's reporting and the conversions aren't there, or the order values are wrong, or the same transaction is being counted multiple times.
This guide is structured around the dependency chain — because understanding what relies on what is what makes troubleshooting possible.
The dependency chain
Before touching any GTM configuration, it's worth mapping out what depends on what. Rakuten affiliate tracking in a server-side GTM setup involves five layers, and each one is a potential point of failure.
1. Rakuten variables correctly defined in web GTM
The Rakuten site ID, affiliate ID, and order variables must be defined as GTM variables before they can be referenced by any tag. If these aren't correctly set up — particularly the Rakuten site ID — nothing downstream will work. This is the most common point of failure and the one that's hardest to diagnose because the tag can appear to fire while passing null or undefined values.
2. Data layer populated before tags fire
The order values — transaction ID, revenue, currency, items — need to be pushed to the data layer before the GTM tags that read them fire. If the data layer push happens after the tag fires, GTM reads undefined values. This is a timing problem, not a configuration problem, but it produces identical symptoms.
3. GA4 purchase event fires with correct parameters
The GA4 purchase event needs to include transaction_id, value, currency, and the items array. These parameters are what the server-side container reads to construct the Rakuten conversion request. Missing or malformed parameters here propagate directly to the Rakuten pixel.
4. Server-side container receives and parses the GA4 event
The server-side GTM container needs to receive the GA4 event payload and correctly identify the GA4 client. If the measurement ID isn't correctly configured or the request routing isn't set up, the event never reaches the server container.
5. Rakuten tag fires from server container with correct variables
The Rakuten pixel tag in the server container reads the event data and constructs the conversion request. If the variables from steps 1–4 are all correct, this step works. If any upstream step has a problem, this step fires with wrong or missing data — or doesn't fire at all.
Web GTM setup
This is the step most implementations get wrong. Before creating any tags, define the following as GTM variables. These need to be available at the time the confirmation page loads — not after an async call completes.
Variables you need to define
- Rakuten Site ID — found in your Rakuten affiliate dashboard. Create a GTM Constant variable named
Rakuten - Site IDand paste the value directly. Do not read this from the data layer — it's a fixed value per account. - Transaction ID — the unique order identifier. Should come from the data layer:
ecommerce.transaction_id. Create a Data Layer Variable pointing to this path. - Order Revenue — the order total Rakuten should receive. Typically
ecommerce.valuefrom the data layer. Confirm whether Rakuten expects the value including or excluding tax for your account — this varies by merchant agreement. - Currency — ISO 4217 code (e.g.
USD,EUR). Should match the currency passed to GA4.
undefined to the Rakuten pixel — and the conversion will not register.The data layer push containing your order data must happen before the GTM tags that read it fire. On most e-commerce platforms, the confirmation page loads the order data synchronously — but on some implementations (particularly headless or SPA setups), the order data is fetched asynchronously after the page loads.
In GTM preview mode on the confirmation page, check the Events tab in the left panel. The dataLayer push containing ecommerce data should appear before the purchase event and before your Rakuten tag fires. If the purchase event fires first and the ecommerce push comes after, your tags are reading empty values.
If the timing is wrong
The fix depends on the platform. For most setups, the data layer push needs to move earlier in the page load sequence — ideally synchronously in the page <head> before the GTM snippet. On SPA or headless setups, you may need to trigger the GTM tags on a custom event that fires after the order data is confirmed to be available, rather than on Page View.
The GA4 purchase event is what carries the order data from the browser to the server-side container. The server-side Rakuten tag reads its values from this event — so whatever parameters are missing or malformed here will be missing or malformed in the Rakuten conversion request.
The GA4 purchase event must include all of the following:
// Required parameters for GA4 purchase event
{
"event": "purchase",
"ecommerce": {
"transaction_id": "ORDER-12345", // string, unique per order
"value": 49.99, // number, not string
"currency": "USD", // ISO 4217 — not "$" or "£"
"items": [{
"item_id": "SKU-001",
"item_name": "Product Name",
"price": 49.99,
"quantity": 1
}]
}
}
Common parameter errors that will silently break the Rakuten conversion: value passed as a string ("49.99" instead of 49.99), currency passed as a symbol rather than an ISO code, transaction_id not unique per order, or the items array being empty.
Server-side GTM setup
Before configuring the Rakuten tag in the server container, confirm that the server-side container is actually receiving GA4 events from the browser. In your server-side GTM container, go to Preview mode and trigger a purchase on the site. You should see the purchase event appear in the server-side preview stream with the full event data.
If no events are appearing in the server-side preview, the problem is the routing from web GTM to the server container — not the Rakuten configuration. Check that the GA4 tag in your web container is sending to your server-side container URL rather than directly to www.google-analytics.com. The transport URL in the web GTM GA4 configuration tag should point to your server-side container endpoint.
What the event data should look like in the server container
In server-side GTM preview, click the purchase event and check the Event Data panel. You should see all the GA4 parameters from step 3 — transaction_id, value, currency, items. If any are missing here, the problem is upstream in the web GTM configuration, not in the server container.
With the server container confirmed to be receiving purchase events, configure the Rakuten pixel tag. Use the Rakuten Affiliate Tag template if it's available in the template gallery for your container — if not, you'll need a custom HTML tag or a custom template.
Key configuration fields
- Site ID — map this to the Rakuten Site ID constant you defined in web GTM. In the server container, you can read this from the event data if you're passing it as a custom parameter, or define it as a server-side variable constant.
- Order ID — map to
transaction_idfrom the event data. - Revenue — map to
valuefrom the event data. Confirm the value type — Rakuten expects a number. - Currency — map to
currencyfrom the event data.
Trigger configuration
Set the trigger to fire on the purchase event only. Do not fire on all events — the Rakuten pixel should only fire once per purchase, on the confirmation event. Add a condition that transaction_id is not undefined to prevent the tag firing if the order data isn't present.
Troubleshooting — symptoms and causes
The following covers the most common failure scenarios, organised by what you're seeing rather than where the problem is. In each case, start your investigation at the top of the dependency chain.
The most common cause is the Rakuten Site ID being undefined or empty when the tag fires. Open GTM preview mode on the confirmation page and check the Variables tab. Look for your Rakuten Site ID variable — if it shows undefined, null, or an empty string, this is the problem.
Secondary causes: the Rakuten tag in the server container isn't being triggered (check the server-side preview — is the tag appearing in the fired tags list?), or the server container isn't receiving the purchase event at all (check whether the web GTM GA4 tag is routing to the server container endpoint).
The conversion is registering — the Site ID is correct — but the revenue value is wrong. Most commonly this is a type mismatch: value is being passed as a string ("49.99") rather than a number (49.99). Check the GA4 purchase event in DebugView and confirm the value parameter type.
Secondary cause: the data layer variable for revenue is reading from the wrong path, or the value is being read before the data layer push has completed and is returning undefined — which Rakuten then interprets as zero.
value is pushed to the data layer as a number, not a string. In your GTM Data Layer Variable for revenue, do not apply any string formatting. If the platform pushes it as a string, use a GTM variable transformation or a custom JavaScript variable to parse it: return parseFloat({{DL - Revenue}});Almost always caused by both a client-side and server-side Rakuten pixel firing for the same purchase. Check your web GTM container for any existing Rakuten tags — if you've added a server-side implementation without removing the original client-side pixel, every conversion will be counted twice.
Secondary cause: the confirmation page loading multiple times (e.g. user refreshing the page), with no deduplication logic in place. Rakuten does have some deduplication based on transaction ID, but this only works if the transaction ID is correctly passed.
transaction_id is always correctly populated — Rakuten uses this for deduplication on their end.The tag fires but the variables it's passing are empty or malformed, so Rakuten receives the request but can't process it as a valid conversion. This is different from the tag not firing — the network request goes out, but with no meaningful data.
In server-side GTM preview, click the Rakuten tag in the fired tags list and check the outgoing request details. Look at the actual URL or payload being sent — specifically the site ID, order ID, and revenue parameters. If any are empty or undefined in the outgoing request, the problem is in how the server container tag is reading the event data.
transaction_id, not GTM variable names like {{DL - Transaction ID}}. Use the Event Data variable type in server-side GTM and specify the exact key name.Final verification checklist
Before considering the implementation complete, work through each of these in order. Each step confirms the previous dependency is working correctly.
