sp-dev-fx-extensions icon indicating copy to clipboard operation
sp-dev-fx-extensions copied to clipboard

How do i configure multiple tracking codes for different site collections

Open PikeSal opened this issue 2 years ago • 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.

PikeSal avatar May 09 '22 20:05 PikeSal

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

ghost avatar May 09 '22 20:05 ghost

Any update?

PikeSal avatar May 16 '22 13:05 PikeSal

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.

mohammadamer avatar Feb 13 '23 19:02 mohammadamer