Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Integrate Google Analytics with ‘Generic Analytics Snippet’

Avatar

Level 5

Hi masters!

Anybody has tried to integrate Google Analytics with ‘Generic Analytics Snippet’, in the Cloud Services Configurations Tool [1]? It seems very easy, but I’ve done exactly the steps in [2] and it doesn’t work for me.

I’ve followed the breadcrumb till the /libs/cq/cloudserviceconfigs/components/servicelibs/servicelibs.jsp, and maybe this code doesn’t work for ‘generic-tracker’ (‘Generic Analytics Snippet’) configurations. I mean, in line 60, it gets the ‘Service’(s).

Service service = services.next();

In my case, this service points to ‘/etc/cloudservices/generic-tracker’ (that’s fine!). But later, in line 62, it gets the property ‘libsScript’, which it doesn’t exist.

String libsScript = props.get("libsScript", null);

It should get the ‘google-analytics’ configuration and then get the ‘snippetCode’ property of that configuration. Isn’t it?

Could anybody confirm that this doesn’t work? Are there any workaround (or which is the best one)?

Thank you very much masters! Best regards!

 

[1] http://localhost:4502/etc/cloudservices/generic-tracker.html

[2] http://dev.day.com/docs/en/cq/current/administering/external_providers.html

1 Accepted Solution

Avatar

Correct answer by
Level 5

I've solved my issue. I forgot to include the 'cq/cloudserviceconfigs/components/servicecomponents' component.

<cq:include path="cloudservices" resourceType="cq/cloudserviceconfigs/components/servicecomponents"/>

Just before the </body> tag, in my template component.

 

Maybe this can help to somebody in the future.

Regards, masters,

Julio.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 5

I've solved my issue. I forgot to include the 'cq/cloudserviceconfigs/components/servicecomponents' component.

<cq:include path="cloudservices" resourceType="cq/cloudserviceconfigs/components/servicecomponents"/>

Just before the </body> tag, in my template component.

 

Maybe this can help to somebody in the future.

Regards, masters,

Julio.

Avatar

Level 10

Thanks Julio for updating the post with the solution. 

Avatar

Level 1

Hi Julio i tried your solution but it still did not work for me ? am i missing something ?