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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Uncaught SyntaxError: Unexpected token >

zachh54251853
Level 1
Level 1

We're seeing the error above on all of our pages that contains "alexa-skills-kit" anywhere in the last part of the URI (after the last / ). Does Adobe Analytics have any special requirements when it comes to the URL? We're not seeing this issue on any other pages, and they all use the same script information. The error is located on the Footer line below.

Header:

    <script src="//assets.adobedtm.com/2c02c31d2aed638ba6c6ca977df6b73f9ff514c3/satelliteLib-38635b7dc936a1789c429e0c77550bc7a78f33af.js"></script>

    <script src="https://assets.adobedtm.com/2c02c31d2aed638ba6c6ca977df6b73f9ff514c3/s-code-contents-373b2dd14221c28..."></script>

Footer: <script type="text/javascript">_satellite.pageBottom();</script>

1 Accepted Solution
Josh_Du
Correct answer by
Level 9
Level 9

So it's kind of hard to give a definitive answer to this because of the way DTM digests and (dynamically) outputs tags, and this is all I have to go by (vs. being able to see the tag within the DTM interface), but it looks to me like there is a difference in formatting in the prod version vs. staging (unpublished) version of a tag in a rule named ""Amazon Pixel - Alexa" (the last rule to trigger before the error, according to DTM notifications). Namely, looks like there is a loss in line breaks which may be causing issues. My guess is since the line breaks are missing, perhaps there is a comment line (// some comment) that's effectively commenting out parts of the code, being all on one line w/out line breaks.

As a first level of effort, can you try disabling this rule (unpublished) to see if the error goes away?

But overall, I do not see the error in prod mode; only stage mode. So it is something unpublished that's the culprit.

View solution in original post

4 Replies
Josh_Du
Level 9
Level 9

This sounds like a problem with a tag or rule implemented through DTM, not the DTM script itself.

My personal guess is you have a page load rule with a condition to trigger on URLs such as that, and you attempted to put some html remarketing tag into a javascript type 3rd party container. 

In any case, you will need to provide more details for what rule(s) trigger on those URLs, or provide an example URL for us to look at.

peterc87726262
Level 1
Level 1

Continuing on with this question.

The Uncaught SyntaxError: Unexpected token > seems to be related to a page load rule associated with a tracking pixel to fire on "alexa-skills-kit" URL's.

Link:

https://developer.amazon.com/alexa-skills-kit

Alexa Skills Kit - Build for Voice with Amazon

Opening up the console, that The Uncaught SyntaxError: Unexpected token >  links to the footer code

Footer: <script type="text/javascript">_satellite.pageBottom();</script>

Does placing the footer code more to the bottom of the page address this issue? (see page source code)

Josh_Du
Correct answer by
Level 9
Level 9

So it's kind of hard to give a definitive answer to this because of the way DTM digests and (dynamically) outputs tags, and this is all I have to go by (vs. being able to see the tag within the DTM interface), but it looks to me like there is a difference in formatting in the prod version vs. staging (unpublished) version of a tag in a rule named ""Amazon Pixel - Alexa" (the last rule to trigger before the error, according to DTM notifications). Namely, looks like there is a loss in line breaks which may be causing issues. My guess is since the line breaks are missing, perhaps there is a comment line (// some comment) that's effectively commenting out parts of the code, being all on one line w/out line breaks.

As a first level of effort, can you try disabling this rule (unpublished) to see if the error goes away?

But overall, I do not see the error in prod mode; only stage mode. So it is something unpublished that's the culprit.

View solution in original post