Rakuten server-to-server tracking

Author
Stape
Published
Sep 16, 2022
Also available in

Rakuten has long been a leader in affiliate marketing, and now they're among the first who started to support server-to-server tracking. S2S technology allows direct communication between the publisher server and Rakuten servers. When using a custom domain, s2s tagging relies on first-party cookies, which live longer than third-party cookies. Increasing cookie lifetime considerably affects affiliate marketing results and affiliate commission.

This article will look closely at Rakuten's server-to-server tracking and how you can set it up using the server Google Tag Manager container.

How Rakuten's server-to-server tracking worksCopy link to this section

Rakuten's server-to-server tracking works similarly to other affiliates’ s2s tracking (we already have blog posts and tags for Awin, Impact, Refersion, Outbrain, and Taboola). 

When a customer clicks on an affiliate link, their click is tracked and stored as a first-party cookie in the user’s browser. When the customer completes a purchase, the order information is passed back to the Rakuten server, with the click ID from cookies and order parameters configured in sGTM. 

Then Rakuten uses server GTM data to attribute the sale to the correct affiliate. This process happens without the need for 3rd party cookies, making it more accurate and reliable since 1st party cookies are longer live.

Benefits of Rakuten's server-to-server trackingCopy link to this section

Rakuten’s server-to-server integration has several benefits over traditional browser-based tracking. 

First, because s2s tagging doesn't rely on 3rd party cookies, it is not susceptible to decreased cookie lifetime. You can be sure that Rakuten accurately tracks affiliates' sales and attributes them appropriately.

Second, moving tags to the server-side decreases the browser load. Which, in the end, might speed up your site. Of course, moving only Rakuten to the server-side won’t have a significant effect. But if you follow the best practice and have one data stream to sGTM, which then distributes data to all tracking platforms, it might have improved website page speed significantly. 

The third one is user privacy. With s2s tracking, you can strictly control what data is sent to each vendor and ensure that they do not scrape any information about website users without your permission using tracking pixels.

How Rakuten s2s tag for server GTM worksCopy link to this section

The documentation for a server-to-server integration with Rakuten is not publicly available. You need to ask your Rakuten representative for access.

1. The Rakuten tag is not yet in the server Google Tag Manager template gallery. You can download it from GitHub and add it to your server GTM container by opening the template tab, clicking new, clicking three dots in the top right corner, and clicking import. 

rakuten server to server tag

2. The first step in setting up Rakuten s2s integration is configuring the pageview event. When a pageview triggers, tag stores the siteID, ranMID, ranEAID, and ranSiteID URL parameters inside the rakuten_ cookies.

rakuten server to server pageview tag

3. Once the pageview event is set up, open sGTM debugger, add all needed parameters to the URL, and check cookies were created correctly.

check Rakuten server cookies

4. When setting up a conversion event, you must add a list of parameters. 

Stape Container API Key - It can be found in the detailed view of the container inside your Stape account.

Because Rakuten Affiliate API authentication works, it can't be fully functional on sGTM. That's why this tag requires working on Stape hosting. If it is possible in the future to use only sGTM for authentication, we will update this tag to support any hosting.

Affiliate Merchant ID (MID) and Affiliate Key - You can find it in your Rakuten account or by contacting your Rakentan account manager.

Order ID - a unique transaction number composed of 1 to 40 nonblank characters. This should be the same as the orderID value you initially reported for the sale in the MOP.

Currency - The ISO4217 currency code reference. Use (‘USD,’ ‘CAD,’ ‘GBP,’ ‘JPY,’ ‘BRL,’ or ‘AUD’) for U.S. dollar, Canadian dollar, British pound, Japanese yen, Brazilian real, or Australian dollar.

You can also select the Override items array. The tag takes items from the event data by default, but you may want to override it. 

Add user data to the field Optional Data. 

Rakuten conversion server event

Conclusion:Copy link to this section

Server-to-server tracking is a game changer for affiliate marketing since it addresses the issue of decreased cookies lifetime. It allows tracking sales from affiliates more accurately and attributes sale commissions without relying on 3rd party cookies whose lifetime can be shortened to 1 or 7 days.

Rakuten and some other affiliate networks started to force their publisher to implement s2s integration. If you're looking for a more accurate and reliable way to track your sales, you should consider using Rakuten's server-to-server tracking.

If you need assistance setting-up server-side tagging, do not hesitate to reach out.

Need help with setting up server-side tagging?

All it takes is a few simple questions. Click Get assistance, fill-up the form, and we will send you a quote.

Get assistance
Tagged with:sGTM tag

Host your GTM server at Stape