Highlighted

Url and referer in Mobile SDK

thomas_annerel
New Member
thomas_annerel
Dear, I succeeded in loading Tealium in a test app and I'm now configuring ga and a custom tag. Is it possible to override the url and the referer url otherwise the location of the mobile.html is used. With the custom container I can do some nifty tricks like manually setting the document.referer (document.location will cause redirect) On of the idea's I was thinking was hosting the mobile.html on my domain and then using html5 history api to change it . See following example. http://html5demos.com/history/third Any build-in tricks or do I need to make my hands dirty :) Kind regards T
7 REPLIES 7

Url and referer in Mobile SDK

jared_hislop
Employee Emeritus
jared_hislop
Hey Thomas, Are you trying to solve for the the "Pages" report in GA using the current URL of the page, which would be the tags.tiqcdn.com page? If not, can you explain what you are trying to solve for? Thanks

Url and referer in Mobile SDK

Tealium Employee

If you wish to override the default mobile.html location, the Android Library (https://github.com/Tealium/android-library) has a config method called setMobileHtmlUrlOverride (https://github.com/Tealium/android-library/wiki/API-Tealium.Config#tealiumconfig-setmobilehtmlurlove...) where you can provided a alternative location. In order to do this in iOS use the initSharedInstance:profile:target:options:globalcustomdata: (https://github.com/Tealium/ios-library/wiki/API-4.x#initsharedinstanceprofiletargetoptionsglobalcust...) method adding the key TealiumDSK_OverrideUrl (NOTE: name of the constant, not the desired string value) with the value being the desired mobile.html location.

Url and referer in Mobile SDK

Tealium Employee
Hi Thomas, It sounds to me like you just want to override the URL that's appearing in Google Analytics, which can be done easily by mapping a value to "Page" in GA, which will force GA to use the custom value you pass in, rather than the default (window.location.href). Does that help? Craig.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Url and referer in Mobile SDK

thomas_annerel
New Member
thomas_annerel
indeed

Url and referer in Mobile SDK

thomas_annerel
New Member
thomas_annerel
The problem is that the google analytics doesn't allow you to override the host and if we want to make a view (with filter on hostname) it's difficult because you need to make filter on tags.tiqcdn.com, with multiple apps this will make a mess. https://ssl.google-analytics.com/__utm.gif?utmwv=5.6.3&utms=31&utmn=1962539500&utmhn=tags.tiqcdn.com... So I got 2 possibilities: - Go for a custom mobile.html page; or I create a CNAME on top of tags.tiqcdn.com (don't know that Tealium allows this) - Create a new GA account for the app

Url and referer in Mobile SDK

Tealium Employee
I recommend using Universal Analytics if you can, which allows to to override the hostname. See https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#hostname for details.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Url and referer in Mobile SDK

thomas_annerel
New Member
thomas_annerel
Hey Craig I just went for that. Thanks, both solutions work but this one feels more standaard. Still one problem the Tealium Analytics Universal Tag doesn't seems to allow to overriding the referer. If I look google analytics universal allows this.