SharePoint On-premises (2013, 2016, 2019) integration

Integration for: SharePoint On-premises 2013, 2016, 2019.

When you want to collect data about SharePoint users in your company, you need to integrate Piwik PRO with SharePoint. SharePoint sites can’t be tracked like a regular website, so they need a dedicated setup. The integration takes a few larger steps and may involve a few people from your company, but we’ll try to show you the path as clearly as possible.

SharePoint report in Piwik PRO

Steps

Install the connector between SharePoint and Piwik PRO

As the first step, you need to install the connector between SharePoint and Piwik PRO.

Needed permissions and modules:

  • RDP access to SharePoint Server  
  • SharePoint farm admin account
  • PnP PowerShell 3.23.2007.1 (If you don’t have it installed yet, deployment scripts will install it automatically.)

Note: For SharePoint 2019, you need to create and register an app catalog.

  • Open your SharePoint 2019.
  • Go to Central Administration.
  • In Web Application, choose the application used as a tracker. Example: https://piwik-sp:0000/.
  • Click OK.

To install the connector, follow these steps:

  1. Contact us at support@piwik.pro, and we’ll send you a package with all resources.
  2. Run Windows PowerShell as a farm administrator from the installation directory on SharePoint Server.
  3. Open the Provision-ToSharepoint.ps1 script in a code editor.
  4. In the script, set up the following variables:
    SharePoint integration (script)
    • $sharepointAdminLogin: A SharePoint farm admin with a format: domain\userid.
    • $clientIdValue: Client ID from Piwik PRO. Where to find it?
    • $clientSecretValue: Client secret from Piwik PRO. Where to find it?
    • $serviceUrlValue: Your Piwik PRO account address. Example: https://example.piwik.pro.
    • $containersUrlValue (optional): Piwik PRO container address. Example: https://example.containers.piwik.pro.
    • $wspSolutionpath: A path to the solution file.
    • $activateFeatureStapplerOnDefault: $true if you want to enable the tracker
    • feature on all new site collections. Note: It doesn’t activate the tracking.
    • $activateTrackerOnOldConnectorSites (optional): $true if you want to enable the tracker feature on the sites where the previous version of Piwik PRO tracker is installed.
  5.  Run the Provision-ToSharePoint.ps1 script and add correct parameters.

    Example:

    .\Provision-ToSharePoint.ps1 -SharePointUrl "https://example.sharepoint.com" -SharePointVersion “2013” -Owner "EXAMPLE\user" -SharePointTenantAdminUrl "https://example.sharepoint.com/sites/tenantadmin"

    Parameters:

    • SharePointUrl (required): Your SharePoint account address. Example: https://example.sharepoint.com.
    • SharePointVersion (required): Your SharePoint version. Example: 2013, 2016, 2019 or Online.
    • Owner (required): The login of a user who will be the owner of Piwik PRO
    • Administration site collection.
    • SharePointTenantAdminUrl: Tenant admin URL. It’s used by  Sharepoint PnP
    • connection. If there’s no tenant admin site, add your main site + /sites/tenantadmin. Example: https://example.sharepoint.com/sites/tenantadmin.
  6. After the script is finished, you’ll see Piwik PRO Administration site in SharePoint.
  7. Open Piwik PRO Administration site: https://[your-SharePoint-URL]/sites/PiwikAdmin.
  8. Click on the settings wheel in the menu bar.
  9. Choose Piwik PRO settings.
    Piwik PRO settings in SharePoint
  10. Go to Connection Settings.
  11. Type in your Piwik PRO account details:
    SharePoint connector (settings)
    • Piwik PRO Instance URL: Your Piwik PRO account address. Example: https://example.piwik.pro.
    • Piwik PRO Custom Containers URL (optional): Piwik PRO container address. Example: https://example.containers.piwik.pro.
    • Piwik PRO Client ID: Client ID from Piwik PRO. Where to find it?
    • Piwik PRO Client Secret: Client secret from Piwik PRO. Where to find it?
  12. Click Submit.

Set up tracking for a site collection

As the second step, you need to turn on tracking for a site collection in SharePoint. A site collection is SharePoint’s name for something similar to a website. It’s a group of sites that have the same owner and share administrative settings.

Needed permissions: Site Collection Administrator in SharePoint.

To turn on tracking for a site collection in SharePoint, follow these steps:

  1. Log in to SharePoint.
  2. Navigate to the site collection that you want to work with.
  3. Click on the settings wheel in the menu bar.
  4. Choose Piwik PRO settings.
    Piwik PRO settings in SharePoint
  5. In Site collection settings, check Enable tracking.
    SharePoint integration (enable tracking)

    Note: It may take up to 30 minutes for tracking to start off because SharePoint’s search crawl needs to notice changes in settings. Also you may need to empty a browser cache because it stores tracker settings for 1 hour, or you can wait for it to refresh.

  6. To check if tracking for a site collection is active, look for User information under Piwik PRO Settings. This section will only appear if tracking has started.
    SharePoint integration (user information)
  7. You can also check the tracking status on SharePoint’s administration site: <your SharePoint URL>/sites/PiwikAdmin > Site contents > Piwik PRO site directory.
    SharePoint integration (status)

    Note: Active means that Piwik PRO tracks the site collection. The tracked site collection will be automatically added as a new site to Piwik PRO.

  8. In User information, you can choose to anonymize user IDs and collect additional data:
    SharePoint integration (user information)
    • Send User ID anonymized: Users will still be recognized, but we’ll hide their ID.
    • Send extended user information: Check if you want to collect additional user data as custom dimensions in Piwik PRO Analytics:
      • Username (display name)
      • Office
      • JobTitle
      • Department
  9. You can also change settings for all sites at once in Global Settings.
    SharePoint integration (global settings)

Turn on SharePoint reports in Piwik PRO

As the last step, you only need to turn on SharePoint reports in Piwik PRO.

Needed permissions: owner

To turn SharePoint reports on, follow these steps:

Available from version 16.0.0. For versions below 16.0.0, go to Menu > Administration > Websites & apps > Settings > Integrations.

  1. Go to Menu > Administration.
  2. Select a website you want to work with.
  3. Navigate to Reports.
  4. Turn on SharePoint reports.
    Show SharePoint reports
  5. Now SharePoint reports will appear under Analytics > SharePoint.
    SharePoint reports in Piwik PRO

    Tip: Read more about SharePoint reports.

Was this article helpful?

Technical support

If you still have some questions, visit our community.
There’s always someone ready to help!

Back to help center