• Srinivas d 7
  • 0 Points
  • Member since 2017

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 2
Hi all,

I don't know if this is the suitable place to post this thread.
I have to embed a Google Analytics code to my Visualforce page. The VF page is already published on the Web through a created site.

I added the GA code between the <script> </script> in the head tag in the visualforce this way:
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  ga('create', 'UA-mycode-1', 'auto', {'allowLinker': true});
  ga('require', 'linker');
  ga('linker:autoLink', ['mycompany.com'] );

The Visualforce URL is something like this:
Is the GA code embedded in my Visualforce correct?, especially:

1. Is the domain name in the last line correct?
2. Is there something missing there?. The aim is to get the VF page tracked.

I would appreciate any help.


I'm trying to get a child field with SOQL, but I not have success.

I must get the fields of Object Account and Object Product_Account (Child of Account).

I write A query like this:

LIST<Account> accounts = [SELECT Account.Name, (SELECT Product_Account__c.Status__c FROM Product_Account __r) FROM Account];
for(Account account : accounts){
 System.debug('Account Name: ' + account.Name + ', Product Name: '+ HERE I WANT GET THE VALUE FROM "Product_Account__c.Status__c" FIELD);

Is it possible to do?