Expand my Community achievements bar.

Help shape the future of AI assistance by participating in this quick card sorting activity. Your input will help create a more effective system that better serves your needs and those of your colleagues.
SOLVED

Cannot send beacon: TypeError: window.location.query is not a function

Avatar

Level 2

Hi there -

Hoping you can help me understand why I a getting the error: 

Cannot send beacon: TypeError: window.location.query is not a function

 

Here is the window.location.query code I found in the Launch library that I think is causing the issue:

settings: {
orgId: "Xreplaced the value hereX@AdobeOrg",
customSetup: {
source: function() {
console.log(window.location.query("cmp"))
}
}, 

 

In Launch, I have a data element %campaignid% that is set to capture value from cmp query string parameter. 

puckingfeachy_0-1620842678731.png

 

This value is passed on global page view and one other rule.

 

The page view isn't showing up in Adobe.

 

Am I missing something? Is there something else I can share to make the scenario more clear?

 

Thanks,

 

PFeach

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

I see the Storage duration is set to session - So I suspect the initial page view was missing that parameter so that value carried as empty the rest of the session.

 

https://experienceleague.adobe.com/docs/launch/using/ui/data-elements.html?lang=en

View solution in original post

6 Replies

Avatar

Level 2

Someone added console.log(window.location.query("cmp")) to custom code section in Adobe Analytics extension. Was it me? May very well have been. I am not here to point fingers, lay blame; I'm here for the laughs - the highs, the lows and all the in-betweens.

Thanks.

Avatar

Community Advisor

I'm not sure where that code is coming from. I'm pretty sure it's not from the Core extension itself. It looks like it could be coming from a Condition or Action in one of your Rules.

Anyway, try replacing "window.location.query" with just "location.query".

Avatar

Level 4
query is not an property on location. Based on the name, it seems like query means query-string is desired. In which case - that would be "location.search"

Avatar

Level 2

I found it in the Custom Code section, Adobe Analytics extension. There really is no need for it and it is causing errors...so I've removed it. Thanks for your most helpful reply.

@tim_funk  - but how to return value from QSP? namely cmp value. location.search seems to provide the whole QSP...while I am looking for specific value.

Avatar

Correct answer by
Level 4

I see the Storage duration is set to session - So I suspect the initial page view was missing that parameter so that value carried as empty the rest of the session.

 

https://experienceleague.adobe.com/docs/launch/using/ui/data-elements.html?lang=en