Home > Tracking Campaigns > Voluum

Calling out Geo/Carrier & Device from voluum (20)


08-05-2014 01:16 AM #1 teoooo (Member)
Calling out Geo/Carrier & Device from voluum

Hi guys,

Does anyone have any experience in calling out Geo/Carrier from Voluum?
This is what Voluum tells me to paste as a script

Code:
<script>
function getURLParameter(name) {
    return decodeURI(
        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
    );
}
</script>
So i've to use this code
[CODE]<script>document.write(getURLParameter('model')) </script>[CODE]
to call out whatever data i want to call out.

Does this mean that whatever data i pass from my banner to my landing page would be inside?
Eg. Tapit has carrier=[carrier]&phonemodel=[phone_model]
Do i just put (getURLParameter('carrier') if i want to call it out?

Thanks and do correct me if im wrong.

EDIT: Is there anyway to remove the [] around the keyword?
And I found out that traffic sources don't pass the [country] variable.
Is there anyway to call out the user's country/city?

Thanks.


08-05-2014 01:32 AM #2 jennatalia (AMC Alumnus)

You would need to use Voluum to pass the values to your webpage.

Then in Php you do <? Echo $_get[Voluum parameter];?> where you need the parameter shown. I suggest you include default logic to ensure there is no blank copy.

As for the country, I use cloud flare to determine the country of my visitor. Cloud flare passes the country value through to the destination page.


08-05-2014 01:41 AM #3 teoooo (Member)

Hi jenna,

So instead of

Code:
<script>document.write(getURLParameter('model')) </script>
,
I would use
Code:
<? Echo $_get[Voluum parameter];?>
?

How do i call out the country from cloudflare?
I'm using it as a CDN too.

Thanks.


08-05-2014 02:45 AM #4 jennatalia (AMC Alumnus)

https://support.cloudflare.com/hc/en...eolocation-do-

$_SERVER["HTTP_CF_IPCOUNTRY"]; is the token.


08-05-2014 06:12 AM #5 vitalis (AMC Alumnus)

I rather use the javascript version, so I can use a CDN.

In Voluum, edit your lander URL and add the GETparameters you need.
Example:
mycdn.com/mylander.html?device={device}&osversion={osversion}&country={cou ntry}&os={os}&isp={isp}
You can allso add variables passed by the trafficsource here.

In the HTML, you paste this in your head-section:

Code:
<script>
function getURLParameter(name) {
    return decodeURI(
        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
    );
}
</script>
If you want to output the isp, you do this:
Code:
<script>document.write(getURLParameter('isp')) </script>
Hope that helps.


08-05-2014 12:24 PM #6 teoooo (Member)

Hi Vitalis,

device={device}&osversion={osversion}&country={cou ntry}&os={os}&isp={isp}
where does the lander get these variables from?

Thanks.
EDIT: Oh wait i found out how in Voluum.
Thanks


08-10-2014 07:58 PM #7 heavyt (Senior Member)

is there a way to callout handset like samsung galaxy?


08-11-2014 03:16 PM #8 teoooo (Member)

Hey man there should be a variable in Voluum for handsets.

I think its

Code:
<script>document.write(getURLParameter('model')) </script>


08-11-2014 06:41 PM #9 heavyt (Senior Member)

Got it thanks


03-27-2015 06:31 AM #10 k_love (AMC Alumnus)

In the HTML, you paste this in your head-section:

Code:
<script>
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
);
}
</script>

If you want to output the isp, you do this:

Code:
<script>document.write(getURLParameter('isp')) </script>
Those are the instructions that come from Voluum, but I get blank spaces on my lander and the following error in the javascript console:

Uncaught ReferenceError: getURLParameter is not defined

Anyone know how to fix that error?


03-27-2015 09:26 AM #11 archieaff (Member)

The first Javascript block should be placed before the second one. The function has to be defined (first JS block), before it can be used (second JS block). Otherwise, it will be undefined.
Just show us the whole code, will be easier to help you.


03-27-2015 12:16 PM #12 rob_gryn (Member)

FYI, we're testing a new Carrier/ISP database provider which we hope to replace MaxMind with. MaxMind is utter rubbish in this area but it's what practically all DSPs and networks use.

This change will also allow us to add the WiFi/Carrier rule which will be very accurate.


03-27-2015 03:42 PM #13 k_love (AMC Alumnus)

Ah jeez. I had the top part in the head alright. Problem was, it was also between the <style> tags. All is fine now.

That's what happens when I try to work with javascript late at night.


03-27-2015 05:27 PM #14 sleenirvana (Member)

<script>document.write(getURLParameter('city')) </script>, this is the output

www.xxx.Voluum.com?city={city}, this is the url


same for isp or whatever parameter


04-14-2015 12:15 PM #15 sarsap (Member)

Thanks for the code guys, needed one for HTML to use with CDN.

Another questions is, if the city shows "Unknown" in the URL how can I set something else in the lander?
something default like Country maybe instead of Unknown.

Thanks


04-15-2015 05:03 AM #16 iwarrior (Member)

Quote Originally Posted by zeropark View Post
FYI, we're testing a new Carrier/ISP database provider which we hope to replace MaxMind with. MaxMind is utter rubbish in this area but it's what practically all DSPs and networks use.

This change will also allow us to add the WiFi/Carrier rule which will be very accurate.
Thanks @zeropark !

Works pretty well calling out cities, just one thing, I tried with several IPs from Hidemyass and some of them return this error message in my LP

&voluumdata=vid..00000000-fc14-424e-8000-000000000000__vpid..e303e000-e323-11e4-8cc1-ed2622dddaca__caid..9bcaea4d-d59f-47c4-993c-7a577f45a8b6__lid..e98a7c10-2924-4429-b604-04fffa77f4ef__rt..R__oid1..6c3aba5f-8092-485e-a75a-03a06218cbef__var1..{banner}__rd..,

Is there any way I can put something as default instead of showing this horrible string on the LP?

I used the code provided in this article: http://feedback.Voluum.com/knowledge...eter-on-lander


Thank you!


04-16-2015 02:58 PM #17 rob_gryn (Member)

This normally will occur when an empty value is sent. i.e. This happens when the city can't be recognized by our Geo detection DB (Maxmind).
The placeholder itself is dropped and the following URL string is called out instead.
&voluumdata=vid..00000000-fc14-424e-8000-000000000000__vpid..e303e000-e323-11e4-8c etc.

To get around this issue you can use this script as an alternative:

<script>
function getURLParameter(name, defaultValue) {
"var" getParam = decodeURI(
(RegExp(name + "=" + "(.+?)(&|$)").exec(location.search)||[,null])[1] || ""
);

if(getParam) {
return getParam;
}
return defaultValue;
}

</script>
</head>

<body>
Hello <script>document.write(getURLParameter("model", "City"));</script> user, you just won!
</body>

It will enable you to pass an alternate value should the initial value be empty or dropped.
The value will be defined after the parameter call out (see above "City")


04-16-2015 04:22 PM #18 sarsap (Member)

Thanks Robert but something is not right with the code, got an error in Dreamweaver with this line:

"var" getParam = decodeURI(

Tried to run it anyway but nothing is shown (city, isp)...


04-16-2015 06:34 PM #19 iwarrior (Member)

Thank you @zeropark!


04-17-2015 05:26 AM #20 duck_noodle (AMC Alumnus)

Quote Originally Posted by sarsap View Post
Thanks Robert but something is not right with the code, got an error in Dreamweaver with this line:

"var" getParam = decodeURI(

Tried to run it anyway but nothing is shown (city, isp)...
remove the quote "var"--> var

anyway, testing this since last night and no progress T_T

Click image for larger version. 

Name:	not work.png 
Views:	53 
Size:	199.0 KB 
ID:	6445

when the city parameter is Unknown (no value) , the script write down any available parameter behind it so it become &cn=United Kingdom T_T


Home > Tracking Campaigns > Voluum