pnp/sp-dev-fx-extensions

How do i configure multiple tracking codes for different site collections

PikeSal opened this issue · 3 comments

Sample

js-application-analytics

Author(s)

@hugoabernier

Question

I need to configure Google Analytics on two site collections, the readme mentions adding the tracking ID and URL in config/serve.json, how do i configure tracking for two SharePoint online sites using two Google Analytics tracking IDs.

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Any update?

Hi @PikeSal

One approach could be by set a property bag for every site to hold the tracking Id. Then in your code you could get the tracking id of the current site. doing that will make the SPFx extension work like an extension for every site.

This way will enable you to get analytics for two sites in two different google analytics.