Skip to main content
Level 4
Oct 16, 2015 2:27 AM UTC
Solved

Integrate Google Analytics with ‘Generic Analytics Snippet’

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Julio_BaixauliAccepted solution
Level 4
Oct 16, 2015 2:27 AM UTC

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.

3 replies

New Member
Oct 16, 2015 2:27 AM UTC

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

Translate
smacdonald2008
Level 10
Oct 16, 2015 2:27 AM UTC

Thanks Julio for updating the post with the solution. 

Translate
Julio_BaixauliAuthorAccepted solution
Level 4
Oct 16, 2015 2:27 AM UTC

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.

Translate