Skip to content

Updates to the Analytics.js (Javascript) Source #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 5, 2020

Conversation

segment-sv
Copy link
Contributor

Currently this section of the doc ( lines 54-58) display incorrectly on the web page. The output:

analytics.identify('{{ user.id }}', {
name: '{{ user.fullname }}',
email: '{{ user.email }}'
});

appears like this:

analytics.identify('', {
name: '',
email: ''
});

After researching on stackoverflow, I believe these changes should fix the issue.

Proposed changes

Moved the ignore characters as follows:

OLD
analytics.identify('{{ user.id }}', {
name: '{{ user.fullname }}',
email: '{{ user.email }}'

NEW
analytics.identify('{{ user.id }}', {
name: '{{ user.fullname }}',
email: '{{ user.email }}'

Related issues (optional)

Currently this section of the doc ( lines 54-58) display incorrectly on the web page. The output:

analytics.identify('{{ user.id }\}', {
  name: '{{ user.fullname }\}',
  email: '{{ user.email }\}'
});

appears like this:

analytics.identify('\', {
  name: '\',
  email: '\'
});

After researching on stackoverflow, I believe these changes should fix the issue.
@segment-sv segment-sv requested a review from sanscontext March 5, 2020 16:42
@sanscontext
Copy link
Contributor

Hey there, this doesn't build. The actual change we need to make here is to add more escape characters as { are a reserved character in Ruby and just aren't being correctly escaped.

@sanscontext
Copy link
Contributor

Hm, I'm going to have to troubleshoot this locally. It may be that we just replace the {{ entirely since different parts of the build are disagreeing with them.

@sanscontext
Copy link
Contributor

Okay, I figured out how to do this. Adding a {% raw %} and {% endraw %} tag just inside the code block so that this renders correctly. Whew.

Copy link
Contributor

@sanscontext sanscontext left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@segment-sv segment-sv merged commit 12715ea into master Mar 5, 2020
@segment-sv segment-sv deleted the segment-sv-patch-1 branch March 5, 2020 18:24
bot-docsteam added a commit that referenced this pull request Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants