Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

s.Util.getQueryparam function not pulling data from query string parameter

Avatar

Avatar
Validate 1
Level 1
vijayk79703890
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
vijayk79703890
Level 1

Likes

0 likes

Total Posts

8 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
vijayk79703890
Level 1

03-07-2020

I am in the process of implementing analytics for our website using Adobe Launch. In the custom code editor I am using the custom method to get the query string parameter for s.campaign. However, I see that the code is getting executed but the parameter values is not getting captured. I suspect the URL is stripping off the query string parameters (but it’s is still visible to me on the browser). Am I missing any step or should I be enabling something for this to work? 
please note: the same code when used in the launch property for another website is working just fine and pulling all the query string parameters. 

This code doesn’t work: 

var c = [];

c.push(s.Util.getQueryParam("utm_source"), s.Util.getQueryParam("utm_medium"), s.Util.getQueryParam("utm_campaign"), s.Util.getQueryParam("utm_term"), s.Util.getQueryParam("utm_content"));

s.campaign = c.join(':');

But this one works: 

 

var url = window.location.href;

var c = [];

c.push(s.Util.getQueryParam("utm_source", url), s.Util.getQueryParam("utm_medium", url), s.Util.getQueryParam("utm_campaign", url), s.Util.getQueryParam("utm_term", url), s.Util.getQueryParam("utm_content", url));

s.campaign = c.join(':'); 

Adobe Launch s.Util.getQueryparam tracking code

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Boost 5
Level 2
mesood
Level 2

Likes

16 likes

Total Posts

51 posts

Correct Reply

5 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile

Avatar
Boost 5
Level 2
mesood
Level 2

Likes

16 likes

Total Posts

51 posts

Correct Reply

5 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 5
View profile
mesood
Level 2

28-07-2020

In first scenario, you have to specify the string to check for query string parameters. By default, the utility looks at the browser URL.

 

Ref Doc: 

https://docs.adobe.com/content/help/en/analytics/implementation/vars/functions/util-getqueryparam.ht...