-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
3Questions
-
2Replies
How to use Tealium tags in Community Builder sites
I'm having have few related issues with analytics and Community Builder sites (using the Koa template, but I assume affects other templates like Napili also):
1. The way the Community Builder renders the pages for articles, is it dynamically (via Javascript) assigns the HTML Title for the page to the name of the article.
Google Analytics is showing the page view, but the Page Title is showing "Article Detail", the default title of the page that dynamically renders the articles.
It seems like the timing in which the page view is sent to Google Analytics, happens before Salesforce code to apply the page title is set.
2. We're use Tealium Tag Management to track analytics, which forwards the data to Google Analytics. Tealium suggests to put in their code right after the opening <body> tag.
<script type="text/javascript">
var utag_data = {};
</script>
<script src="//pathToTealium.js" type="text/javascript"></script>
There doesn't seem to be a way to get a Community Builder page to render with this code anywhere in the <body> tag. If I build a Lightning Component with this code, and insert it at the top of the page or anywhere on the page, it pushes the code to the <head> automatically.
If I add the tracking to Community Builder > Settings > Advanced > Head Markup, it puts the code within <head> and it works, except the same issue above occurs with the page titles not showing the article's title. I'm hoping to be able to get this to render in the <body> tag as we may be able to adjust things in Tealium to send the proper analytics, but it doesn't look like we can if it's in the <head> tags.
Note that LockerService will no longer allow us to put this kind of Javascript code in the Head Markup soon.
I've also tried using the native Community Builder method of adding the Google Analytics Id in Community Builder > Settings > Advanced > Google Analytics, and the same problem (Page Title of articles not correct) occurs.
Any ideas on either of these?
1. The way the Community Builder renders the pages for articles, is it dynamically (via Javascript) assigns the HTML Title for the page to the name of the article.
Google Analytics is showing the page view, but the Page Title is showing "Article Detail", the default title of the page that dynamically renders the articles.
It seems like the timing in which the page view is sent to Google Analytics, happens before Salesforce code to apply the page title is set.
2. We're use Tealium Tag Management to track analytics, which forwards the data to Google Analytics. Tealium suggests to put in their code right after the opening <body> tag.
<script type="text/javascript">
var utag_data = {};
</script>
<script src="//pathToTealium.js" type="text/javascript"></script>
There doesn't seem to be a way to get a Community Builder page to render with this code anywhere in the <body> tag. If I build a Lightning Component with this code, and insert it at the top of the page or anywhere on the page, it pushes the code to the <head> automatically.
If I add the tracking to Community Builder > Settings > Advanced > Head Markup, it puts the code within <head> and it works, except the same issue above occurs with the page titles not showing the article's title. I'm hoping to be able to get this to render in the <body> tag as we may be able to adjust things in Tealium to send the proper analytics, but it doesn't look like we can if it's in the <head> tags.
Note that LockerService will no longer allow us to put this kind of Javascript code in the Head Markup soon.
I've also tried using the native Community Builder method of adding the Google Analytics Id in Community Builder > Settings > Advanced > Google Analytics, and the same problem (Page Title of articles not correct) occurs.
Any ideas on either of these?
- Justin Leung
- March 30, 2017
- Like
- 0
- Continue reading or reply
Running Apex code when Email Quick Action is opened
We're currently moving to Case Feeds, and I'm trying to replace our Send Email (custom button) with the Email quick action.
The Send Email button runs Javascript code that calls Apex code which populates a merge field (Articles) with the Article Title and Article URL of each article that's attached to the case so it can be used in email templates.
Ideally, we could create a trigger on CaseArticle to popualte this field whenver an article is attached, but I already know that CaseArticle doesn't support triggers (https://success.salesforce.com/ideaView?id=08730000000izXWAAY).
We've tried to add an Email Quick Action Publisher Loader (Support Settings > Enable Default Email Templates or the Default Handler for Email Action). The code itself works well, but the problem is that this loader only seems to load once when you load the case. The scenario it does not capture is:
1. Browse a case in the service console
2. In the KnowledgeOne sidebar, attach an article to the case
3. Click the Email quick action
4. Select an email template containing this merge field
5. The merge field is not populated with the article that was just attached
Can anyone confirm the Email Publisher Loader only loads once when the case is loaded, or if there's different timing (hopefully something configurable)?
Any other ideas on how we can populate this merge field between the time the article is attached and when someone selects the Email quick action?
The Send Email button runs Javascript code that calls Apex code which populates a merge field (Articles) with the Article Title and Article URL of each article that's attached to the case so it can be used in email templates.
Ideally, we could create a trigger on CaseArticle to popualte this field whenver an article is attached, but I already know that CaseArticle doesn't support triggers (https://success.salesforce.com/ideaView?id=08730000000izXWAAY).
We've tried to add an Email Quick Action Publisher Loader (Support Settings > Enable Default Email Templates or the Default Handler for Email Action). The code itself works well, but the problem is that this loader only seems to load once when you load the case. The scenario it does not capture is:
1. Browse a case in the service console
2. In the KnowledgeOne sidebar, attach an article to the case
3. Click the Email quick action
4. Select an email template containing this merge field
5. The merge field is not populated with the article that was just attached
Can anyone confirm the Email Publisher Loader only loads once when the case is loaded, or if there's different timing (hopefully something configurable)?
Any other ideas on how we can populate this merge field between the time the article is attached and when someone selects the Email quick action?
- Justin Leung
- February 17, 2017
- Like
- 0
- Continue reading or reply
Using knowledge:articleList to search a specific category only
We have a custom Visualforce Community, and have a search page that searches for articles within specific categories.
Data Category Structure:
-- All
---- aaa
---- bbb
---- ccc
------ xxxx
------ yyyy
------ zzzz
---- ddd
---- eee
We use the articleList tag to display search results:
<knowledge:articleList articleVar="article" pageNumber="{!currentPageNumber}" Keyword="{!searchstring)}" hasMoreVar="false" pageSize="10" categories="{!DC}" language="en_US">
{!DC} is populated with the category name depending on which option in the drop down is selected e.g. CATEGORY_GROUP_NAME:xxxx__c if xxxx is selected.
I would expect this to search for articles in the xxxx category only, but what I'm finding, is that it searches for articles in the xxxx category, and all categories above it: ccc, and All. This is counterintuitive, although I do realize that is how the Article Management tab works as well (when you select a category, it searches that category plus everything above it).
How I want it to work, is to search for article in the specific category only, like how this SOQL statement works:
SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus = 'online' and Language = 'en_US' WITH DATA CATEGORY CATEGORY_GROUP_NAME__c AT xxxx__c
Can you guys verify if the articleList tag is supposed to search in categories above the specified category? And if so, do you have any suggestions on how to make the articleList tag search the specific category only?
Data Category Structure:
-- All
---- aaa
---- bbb
---- ccc
------ xxxx
------ yyyy
------ zzzz
---- ddd
---- eee
We use the articleList tag to display search results:
<knowledge:articleList articleVar="article" pageNumber="{!currentPageNumber}" Keyword="{!searchstring)}" hasMoreVar="false" pageSize="10" categories="{!DC}" language="en_US">
{!DC} is populated with the category name depending on which option in the drop down is selected e.g. CATEGORY_GROUP_NAME:xxxx__c if xxxx is selected.
I would expect this to search for articles in the xxxx category only, but what I'm finding, is that it searches for articles in the xxxx category, and all categories above it: ccc, and All. This is counterintuitive, although I do realize that is how the Article Management tab works as well (when you select a category, it searches that category plus everything above it).
How I want it to work, is to search for article in the specific category only, like how this SOQL statement works:
SELECT Title FROM KnowledgeArticleVersion WHERE PublishStatus = 'online' and Language = 'en_US' WITH DATA CATEGORY CATEGORY_GROUP_NAME__c AT xxxx__c
Can you guys verify if the articleList tag is supposed to search in categories above the specified category? And if so, do you have any suggestions on how to make the articleList tag search the specific category only?
- Justin Leung
- August 05, 2016
- Like
- 0
- Continue reading or reply
How to use Tealium tags in Community Builder sites
I'm having have few related issues with analytics and Community Builder sites (using the Koa template, but I assume affects other templates like Napili also):
1. The way the Community Builder renders the pages for articles, is it dynamically (via Javascript) assigns the HTML Title for the page to the name of the article.
Google Analytics is showing the page view, but the Page Title is showing "Article Detail", the default title of the page that dynamically renders the articles.
It seems like the timing in which the page view is sent to Google Analytics, happens before Salesforce code to apply the page title is set.
2. We're use Tealium Tag Management to track analytics, which forwards the data to Google Analytics. Tealium suggests to put in their code right after the opening <body> tag.
<script type="text/javascript">
var utag_data = {};
</script>
<script src="//pathToTealium.js" type="text/javascript"></script>
There doesn't seem to be a way to get a Community Builder page to render with this code anywhere in the <body> tag. If I build a Lightning Component with this code, and insert it at the top of the page or anywhere on the page, it pushes the code to the <head> automatically.
If I add the tracking to Community Builder > Settings > Advanced > Head Markup, it puts the code within <head> and it works, except the same issue above occurs with the page titles not showing the article's title. I'm hoping to be able to get this to render in the <body> tag as we may be able to adjust things in Tealium to send the proper analytics, but it doesn't look like we can if it's in the <head> tags.
Note that LockerService will no longer allow us to put this kind of Javascript code in the Head Markup soon.
I've also tried using the native Community Builder method of adding the Google Analytics Id in Community Builder > Settings > Advanced > Google Analytics, and the same problem (Page Title of articles not correct) occurs.
Any ideas on either of these?
1. The way the Community Builder renders the pages for articles, is it dynamically (via Javascript) assigns the HTML Title for the page to the name of the article.
Google Analytics is showing the page view, but the Page Title is showing "Article Detail", the default title of the page that dynamically renders the articles.
It seems like the timing in which the page view is sent to Google Analytics, happens before Salesforce code to apply the page title is set.
2. We're use Tealium Tag Management to track analytics, which forwards the data to Google Analytics. Tealium suggests to put in their code right after the opening <body> tag.
<script type="text/javascript">
var utag_data = {};
</script>
<script src="//pathToTealium.js" type="text/javascript"></script>
There doesn't seem to be a way to get a Community Builder page to render with this code anywhere in the <body> tag. If I build a Lightning Component with this code, and insert it at the top of the page or anywhere on the page, it pushes the code to the <head> automatically.
If I add the tracking to Community Builder > Settings > Advanced > Head Markup, it puts the code within <head> and it works, except the same issue above occurs with the page titles not showing the article's title. I'm hoping to be able to get this to render in the <body> tag as we may be able to adjust things in Tealium to send the proper analytics, but it doesn't look like we can if it's in the <head> tags.
Note that LockerService will no longer allow us to put this kind of Javascript code in the Head Markup soon.
I've also tried using the native Community Builder method of adding the Google Analytics Id in Community Builder > Settings > Advanced > Google Analytics, and the same problem (Page Title of articles not correct) occurs.
Any ideas on either of these?
- Justin Leung
- March 30, 2017
- Like
- 0
- Continue reading or reply
Running Apex code when Email Quick Action is opened
We're currently moving to Case Feeds, and I'm trying to replace our Send Email (custom button) with the Email quick action.
The Send Email button runs Javascript code that calls Apex code which populates a merge field (Articles) with the Article Title and Article URL of each article that's attached to the case so it can be used in email templates.
Ideally, we could create a trigger on CaseArticle to popualte this field whenver an article is attached, but I already know that CaseArticle doesn't support triggers (https://success.salesforce.com/ideaView?id=08730000000izXWAAY).
We've tried to add an Email Quick Action Publisher Loader (Support Settings > Enable Default Email Templates or the Default Handler for Email Action). The code itself works well, but the problem is that this loader only seems to load once when you load the case. The scenario it does not capture is:
1. Browse a case in the service console
2. In the KnowledgeOne sidebar, attach an article to the case
3. Click the Email quick action
4. Select an email template containing this merge field
5. The merge field is not populated with the article that was just attached
Can anyone confirm the Email Publisher Loader only loads once when the case is loaded, or if there's different timing (hopefully something configurable)?
Any other ideas on how we can populate this merge field between the time the article is attached and when someone selects the Email quick action?
The Send Email button runs Javascript code that calls Apex code which populates a merge field (Articles) with the Article Title and Article URL of each article that's attached to the case so it can be used in email templates.
Ideally, we could create a trigger on CaseArticle to popualte this field whenver an article is attached, but I already know that CaseArticle doesn't support triggers (https://success.salesforce.com/ideaView?id=08730000000izXWAAY).
We've tried to add an Email Quick Action Publisher Loader (Support Settings > Enable Default Email Templates or the Default Handler for Email Action). The code itself works well, but the problem is that this loader only seems to load once when you load the case. The scenario it does not capture is:
1. Browse a case in the service console
2. In the KnowledgeOne sidebar, attach an article to the case
3. Click the Email quick action
4. Select an email template containing this merge field
5. The merge field is not populated with the article that was just attached
Can anyone confirm the Email Publisher Loader only loads once when the case is loaded, or if there's different timing (hopefully something configurable)?
Any other ideas on how we can populate this merge field between the time the article is attached and when someone selects the Email quick action?
- Justin Leung
- February 17, 2017
- Like
- 0
- Continue reading or reply