409 人が現在オンライン
409 人が現在オンライン
Google アナリティクスの Google タグマネージャを含む計測の設定やトラブルシュートなどについて、ユーザー同士で意見交換ができます。解析を通して浮かんだ質問やアイディアを投げかけ合ってより知識を高めていきましょう。
ガイドを表示
star_border
返信

How to relate transationId between two sessions?

初級者 ✭

Hi all, I want to know how to connect the same transactionId but different sessions.

I run e-commerce webiste. Because almost all of our target users use bank transfer, the transaction(=process of payment) happens as follows.

 

step 1. Selecting item, user visits confirmation page, where user can see unique digits code in price(transactionId-A is created)

step 2. User pay

step 3. Third party's bank notification system notifies to our admin(outside from our website) 

step 4. Admin check it and accept that order(transactionId-A is approved)

 

So, our real transaction(payment) happens in step 4. However, step 1 and step 4 are different sessions(user's browser and admin's browser), so i cannot track true transaction.

 

Could you give me some solution how to connect two sessions' transactionId if there is a way?

 

1 人のエキスパートが返信verified_user

Re: How to relate transationId between two sessions?

トップコントリビューター
Hi Taihaku

It is very difficult problem.
For me, I use the following method.

- Use enhanced e-commerce
- Send transaction to GA at step 1 (or step 2)
- Send returned goods data to GA when order is not approved

Re: How to relate transationId between two sessions?

初級者 ✭

Thank you Ryota for kindly replying顔文字 ハッピー

 

 Send returned goods data to GA when order is not approved

 

This means refund goods? I checked the document and the code becomes like:

 

// Refund an entire transaction.
ga
('ec:setAction', 'refund', {
 
'id': 'T12345'    // Transaction ID is only required field for full refund.
});

 

Or, could i achieve what i would like to do by implementing as follows?

 

// In step 1
function addToCart(product) {
  ga
('ec:addProduct', {
   
'id': product.id,
   
'name': product.name,
...
   
'price': product.price,
   
'quantity': product.qty
 
});
  ga
('ec:setAction', 'add');
  ga
('send', 'event', 'UX', 'click', 'add to cart');     // Send data using an event.
}
// In step 4(admin web)
/**
 * Called when the user begins the checkout process.
 * @param {Array} cart An array representing the user's shopping cart.
 */

function checkout(cart) {
 
for(var i = 0; i < cart.length; i++) {
   
var product = cart[i];
    ga
('ec:addProduct', {
     
'id': product.id,
     
'name': product.name,
     
'category': product.category,
     
'brand': product.brand,
     
'variant':  product.variant,
     
'price': product.price,
     
'quantity': product.qty
   
});
 
}
}

// In the case of checkout actions, an additional actionFieldObject can
// specify a checkout step and option.
ga
('ec:setAction','checkout', {
   
'step': 1,            // A value of 1 indicates this action is first checkout step.
   
'option': 'Visa'      // Used to specify additional info about a checkout stage, e.g. payment method.
});
ga
('send', 'pageview');   // Pageview for payment.html

 

Of course step 2 and step 4 are different sessions though. I hope google analytics nicely to collect data for transactions. 

 

What do you think?顔文字 ハッピー

 

Thank you in advance.

 

 

Re: How to relate transationId between two sessions?

初級者 ✭
<input type="text" size="30" maxlength="50" autocomplete="off" id="at-expanded-menu-service-filter" class="at-expanded-menu-search-input" value="" data-reactid=".0.2.0.2.0.0" style="box-sizing: border-box; display: inline-block; height: 50px; width: 340px; padding: 0px; margin: 0px 0px 0px 1px; vertical-align: middle; font-size: 13px !important; line-height: 20px; outline: 0px; border: none transparent; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; color: rgb(238, 236, 236); position: relative; top: -4px; box-shadow: none; -webkit-box-shadow: none; orphans: auto; white-space: normal; widows: auto; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none; background-position: 0px 0px; background-repeat: initial initial;"><br class="Apple-interchange-newline">