Different Google Analytics code based on Users Device
Our site has an odd GA set up with two different GA codes, 1 for desktop, another for mobile. (We use dynamic serving of website code to send different code based on User agent.)
Now we have a blog on sub domain, and as it has it’s own GA code, we cannot attribute channel traffic from the blog to the main site, it just comes in as referral.
To set up correct attribution from a sub domain you need to use the same GA codes, however, as the WordPress blog is responsive, I cannot easily ad two different codes based on device type.
Is there a plugin, or a way to serve different code based on device?