Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
I need to add two Google Analytics IDs – UA and GA4 – to my in5 publications, so I'm using the Resources tab to add the tracking code for the second Google Analytics ID.

This works, but it triggers an "Unexpected token" error in the browser Developer Console for the opening "<" in the first <script> tag in resource-1.js. This makes sense, since <script> is already implied or declared by virtue of a .js file and, I assume, shouldn't be in there.

The solution is easy: open index.html and replace:

<script type="text/javascript" src="assets/js/resource-1.js"></script>

...with the GA tracking code script, but it requires an extra manual step before uploading.

Is there an easier way to do this when publishing with in5?
in how_to by (120 points)
  

1 Answer

0 votes

The issue is you’re placing HTML into a javascript resource (which, as you know, will not have <script> tags). You can either scrub the <script></script> tags and attach it as JS, or just attach what you have as HTML in the Resources tab.

by (9.6k points)