Skip to main content
Troubleshooting: Malformed Tracking Snippets
Updated over 2 months ago

If you're experiencing issues with the RB2B tracking script, it may be due to common errors when sharing or copying the code. Below are the most frequent issues, their causes, and how to resolve them.

1. Malformed Code: Curly Quotes

Prevalence: ★★★★★

When users share the RB2B HTML snippet through chat programs like Slack, these programs often convert the straight quotes in the code snippet to curly quotes (also known as “smart quotes”) unless the script is explicitly sent in a [code] block. Browsers cannot interpret curly quotes correctly, which prevents the script from running.

  • Solution: Copy the script directly from RB2B’s setup page and replace the snippet with the original version. This ensures the use of the correct straight quotes.

  • Tip: If the script needs to be shared again via chat, recommend wrapping the code in a [code] block (e.g., Slack or other platforms) to preserve the straight quotes.

2. Malformed Code: Missing Quotes

Prevalence: ★★★★★

Microsoft Teams and Outlook are frequent culprits for this issue. When users share the RB2B HTML snippet, Microsoft Teams and Outlook can turn the URL within the script.src attribute into a clickable link. This action often removes the straight quotes around the URL, or only leaves one side intact. When the code is then copy-pasted into the website, the script will not function correctly due to these missing quotes.

Example of Incorrect Code:

script.src = https://s3-us-west-2.amazonaws.com/b2bjsstore/b/

Example of Correct Code:

script.src = "https://s3-us-west-2.amazonaws.com/b2bjsstore/b/"
  • Solution: Ensure that the quotes are intact before pasting the code into their site. If necessary, they should retrieve the original script from RB2B’s setup page and verify that the quotes around the URL are present.

3. Malformed Code: Double <script> Tags

Prevalence: ★★☆☆☆

Sometimes, users may accidentally paste the RB2B script within an existing <script> tag from another snippet on their website. This results in double <script> tags, which can prevent both the RB2B script and the existing script from running.

  • Solution: Copy the script directly from RB2B’s setup page and ensure that it is inserted as a separate, standalone <script> tag. This will prevent conflicts and ensure all scripts run properly.

4. Malformed Code: Snippet Inside <style> Tag

Prevalence: ★☆☆☆☆

In some cases, users have mistakenly pasted the RB2B HTML snippet within CSS <style> tags, removing the necessary <script> tags in the process. This prevents the script from functioning since the <style> tag is meant for CSS, not JavaScript.

  • Solution:
    Advise users to retrieve the correct script format from RB2B’s setup page and confirm that it is enclosed within <script> tags. Remind them that JavaScript should never be placed within <style> tags.

Summary & Best Practices

To prevent issues when copying or sharing the RB2B tracking script:

  • Always copy the code directly from RB2B’s setup page.

  • When sharing the code via chat programs, use code blocks or plain text formatting to preserve the correct formatting (especially for quotes).

  • Double-check the placement and structure of the script to ensure it is not nested within other HTML elements like <style> or other <script> tags.

If these steps do not resolve the issue, please contact our support team for additional assistance.

Did this answer your question?