AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
3K members online now
3K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Cross domain Ecommerce tracking-Transaction not linked to the campaign

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi there,

 

I've this scenario:

 

==User land on domainA.com/langding-page with ua code UA-XXXXX-X. User show url like this:

http://domainA.com/langding-page/?email=&date=&split=&utm_source=mch&utm_medium=email&ap_id=&utm_campaign=TEST&utm_content=CONTENUTOTEST&video=1&cosa=1&faq=1

 

 

==user click on link and redirect to domainB.it/checkout/ (ua code: UA-XXXXX-Y) and pay product.

domainB.it track ecommerce transaction and also send transaction to domainA.com

 

On GA UA-XXXXX-X property I can see campaign =>TEST and ecommerce transaction but they are not connected to each other

How can I tie them?

 

This is the code: that work (if someone need) without relations betwenn campain and transaction:

 

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

//domainA.com
ga('create', 'UA-XXXXX-X', 'auto');
ga('set', 'dimension1', 'yes');
ga('send', 'pageview');

ga('require', 'ecommerce', 'ecommerce.js');

ga('ecommerce:addTransaction', {
'id': '123456', // Transaction ID. Required
'affiliation': 'xxx', // Affiliation or store name
'revenue': '39.62', // Grand Total
'shipping': '0', // Shipping
'tax': '7.14', // Tax
'currency': 'EUR' // Currency
});
ga('ecommerce:addItem', {'id': '174359','name': 'ProdA','sku': '165921','category': 'category','price': '32.48','quantity': '1'});
ga('ecommerce:send');// Send transaction and item data to Google Analytics.

//domainB.it
ga('create', 'UA-XXXXX-Y', 'auto',{'name': 'domainA','allowLinker': true });
ga('domainA.require', 'linker');
ga('domainA.linker:autoLink', ['personechepossono.com'] );
ga('domainA.require', 'ecommerce');
ga('domainA.ecommerce:addTransaction', {
'id': '174359',
'affiliation': 'yyy',
'revenue': '39.62',
'shipping': '0',
'tax': '7.14',
'currency': 'EUR'
});
ga('domainA.ecommerce:addItem', {'id': '174359','name': 'ProdA','sku': '165921','category': 'category','price': '32.48','quantity': '1'});
ga('domainA.ecommerce:send');

 

Thank you.

+David

 

 

1 Expert replyverified_user

Re: Cross domain Ecommerce tracking-Transaction not linked to the camp

Top Contributor
# 2
Top Contributor
Hi David :-)
Based on the example code, In order for cross domain tracking to occur, the linked web sites need to be using the same tracking id (UA#)
Also both domains need to be listed on the Referral Exclusion List for the Property that is being used for tracking.
There also needs to be another View setup with the following filter applied,
Filter Type: Custom filter > Advanced
Field A: Hostname Extract A: (.*)
Field B: Request URI Extract: (.*)
Output To: Request URI Constructor: $A1$B1
Click Save to create the filter.

I'm not overly familiar with ecommerce tracking however cross domain tracking setup instructions and code examples can be found here,
you will likely want to make some changes to the code on both sites
https://support.google.com/analytics/answer/1034342?hl=en

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Re: Cross domain Ecommerce tracking-Transaction not linked to the camp

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Bronwyn,

thank you for your response.

I found this https://support.google.com/analytics/answer/1034342?hl=en but I can't use same UA property because we have history data on the 2 account.

There is a way, in your opinion, to track on two separate accounts? With iframe?

Re: Cross domain Ecommerce tracking-Transaction not linked to the camp

[ Edited ]
Top Contributor
# 4
Top Contributor

I'm not understanding your suggestion of using an iframe?

You can keep history data on the 2nd account. That historical information wont go away
unless the related Views, Property or Account is deleted.
So the tracking code can be changed over without losing the historical information for
the other property (if that is a concern)

In instances where an entity is unable to place tracking code on the payment site (eg paypal)
a user is usually redirected back to the originating site. In these cases, if the 3rd party site is
placed onto the GA Referral Exclusion List for the originating site Property, then it allows the
original source/medium to be tracked

Not sure that info is helpful to you.

 

Hopefully someone else here with way better understanding of e-commerce setups than myself,

will be able to help you futher :-)

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here