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
3.1K members online now
3.1K 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

Conversion tracking cross domain showing traffic source as 'direct' (registration form in iframe)

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

We've got an event website (ikwordondernemer.nl/) where the registration form is an iframe as we're using a complete event registration system (with badges and the works) on the domain 'customerview.nl'.

 

I'm trying to correctly attribute the conversions (registrations) in GA, but for some reason it shows all traffic sources as direct (none). Anyone any idea where I went wrong?

 

The code on the website itself is:

<script>
(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');

ga('create', 'UA-36378672-1', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['customerview.nl'] );
ga('send', 'pageview');

</script>

 

Then on the thank you page of the iframe I placed the following code.

<script>

(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');

ga('create', 'UA-36378672-1', 'auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', ['ikwordondernemer.nl']);
ga('send', 'pageview');

</script>

 

I didn't add the code to the registration form itself as it's embedded as an iframe in the page which already has the first code. I've set it up as a goal in GA, and it's tracking every registration. Just not the source.

 

Does anyone have any idea where I'm going wrong?

Re: Conversion tracking cross domain showing traffic source as 'direct' (registration form in iframe

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

HI Pieter- I am very interested to see your resolution here. I am having the same problems!