You need to sign in to do that
Don't have an account?
hksl
Lightning Community call apex in <head> section (Napili template)
Is it possible to make apex calls from <head> section of Lightning Community (Napili template)?
We need to get "User Id" inside <head> section to set custom dimension in Google Analytics.
Tried following script that does not work:
<script>
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
.....code provided by Google Analitics here to integrate ........
ga('create', '...unique id provided by Google Analitics here...', 'auto');
var user = sforce.connection.getUserInfo(); // apex
console.log(user);
//need to call: ga("set", "dimension1", user);
ga('send', 'pageview');
</script>
Any suggestions will be greatly appreciated.
Thank you
We need to get "User Id" inside <head> section to set custom dimension in Google Analytics.
Tried following script that does not work:
<script>
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
.....code provided by Google Analitics here to integrate ........
ga('create', '...unique id provided by Google Analitics here...', 'auto');
var user = sforce.connection.getUserInfo(); // apex
console.log(user);
//need to call: ga("set", "dimension1", user);
ga('send', 'pageview');
</script>
Any suggestions will be greatly appreciated.
Thank you
Further If it's needed to be accessed by another component, an Application event would do I believe.
Any other ideas? I am stuck at this point unfortunately