banner



How To Download Master Page Sharepoint 365

Mainly targeted to public sites, Google Analytics can also be used to monitor your SharePoint or Office365 intranet. It will non simply help you empathize if employees are using the company intranet only besides how they are using it and if anything needs to exist improved.

Below I explain step past footstep how you can build and deploy a script link using a custom activity in SharePoint, and will also provide the installation files and the instructions to use the script in case y'all don't want to build it yourself.

How to setup Google Analytics

Before we get into the SharePoint bits let'southward set up Google Analytics and get everything y'all demand.

  1. Sign in to your Analytics account
  2. Select the Admin tab
  3. Select an account from the menu in the Account cavalcade, or Create New Account if yous don't have one already
  4. Select a property from the menu in the Property column
  5. Under Holding, click Tracking Info Tracking Code
  6. Save the Website tracking script code

    Save Google Analytics tracking code

Notice more than data most google analytics setup

Create SriptLink Custom Action

If you lot don't want to deal with code at all, jump to the side by side section.

Heads upward! The solution built in this tutorial uses a declarative SandBox solution to deploy Google Analytics. These blazon of solutions are supported by Microsoft in the about recent versions of SharePoint, including SharePoint 2016 and SharePoint Online. You tin read more about this type of solution here.

  1. Open Visual Studio and create a new projection
  2. Select Office/SharePoint templates and SharePoint Empty Project
  3. I will telephone call information technology SharePointGoogleAnalytics, but you can call it whatever yous want

    New SharePoint project

  4. Provide the URL of the site y'all will employ to debug
  5. Select Deploy as sandboxed solution and click Finish

    SharePoint Customisation Wizard

  6. One time your project opens, go to the Backdrop and set up Include Associates in Bundle to False. This is required to build a declarative sandbox solution

    SharePoint Solution Properties

  7. Right click on your projection, go to Add together and select New Item
  8. Select Empty Chemical element and phone call information technology AnalyticsCA - this will be the ScriptLink Custom Action

    Add new item

  9. Correct click on your projection again, become to Add and select New Detail
  10. Select Module and telephone call information technology Style Library
  11. Delete the Sample.txt file that is created past default
  12. Create the folder structure blare inside the Style Library Module GoogleAnalytics js
  13. Right click in the js folder, go to Add and select New Item, from the Spider web group select the JavaScript File and call it ga.js

    SharePoint Project Structure

  14. At this point, your project structure should look like the image bellow

    SharePoint Feature Properties

  15. Open up the Elements.xml file inside the Style Library module. This file is generated by Visual Studio automatically. However, I prefer to alter it and publish the files automatically once the solution is activated. I also supervene upon the files, if a previous version already exists in the system.Select the entire content of the file and supersede information technology with the lawmaking bellow.

    Note: If yous are not using the same names I used previously, make certain you adjust the URL and Path

    <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/">   <Module Name="StyleLibraryJS" Url="Fashion Library/GoogleAnalytics/js" RootWebOnly="FALSE" Path="Fashion Library\GoogleAnalytics\js">     <File Url="ga.js" Type="GhostableInLibrary" Level="Published" ReplaceContent="True"  />   </Module> </Elements>
  16. Open the Elements.xml inside the AnalyticsCA module and paste the code blare.
  17. <?xml version="ane.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/">   <CustomAction     ScriptSrc="~SiteCollection/Manner Library/GoogleAnalytics/js/ga.js"     Location="ScriptLink"     Sequence="ane">   </CustomAction> </Elements>

    This XML file will annals the custom activity and volition execute the ga.js on all sites of your site drove.

    Note: If you are not using the same names I used previously, make certain you arrange the ScriptSrc

  18. Open the Features folder and rename the Feature1 to GoogleAnalytics feature
  19. Open up GoogleAnalytics feature
  20. Blazon a Title and Description for your features. Both fields will exist visible on your site drove
  21. Change the scope from Web to Site, this manner the script will be deployed to all the sites in the site drove

    Add JavaScript File

  22. Open up the ga.js file in the Mode Library module and paste there the script code you got from Google, without the script tags. Your code will be like the code bellow, except for the Track ID.
    (function(i,s,o,1000,r,a,m){i=r;i=i||function(){   (i.q=i.q||[]).button(arguments)},i.fifty=1*new Date();a=due south.createElement(o),   thousand=s.getElementsByTagName(o);a.async=1;a.src=g;thou.parentNode.insertBefore(a,m)   })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');    ga('create', 'Track ID', 'motorcar');   ga('ship', 'pageview');              
  23. Compile your project and deploy the solution to all the site collections you want to track

Once you lot deploy the solution, your Google Analytics dashboard will immediately display real-fourth dimension information.

Add JavaScript File

Install Google Analytics on SharePoint

Note: This topic is mainly for the users that didn't build their ain custom action project.

To install the solution in your SharePoint and offset tracking your sites follow these steps:

  1. Download the solution
  2. On your site drove root site go to Settings Site Settings Solutions
  3. Upload and activate the solution. Once you activate the solution, the Google Analytics script is immediately added to your site however, it is not tracking your site all the same, you lot even so need to add your track id to the script
  4. Open your site with SharePoint designer
  5. Become to All Files Mode Library Google Analytics js
  6. Check out and edit the ga.js file in advanced manner
  7. Locate the words TRACK ID and replace information technology with your own rails id from Google Analytics

    Add JavaScript File

  8. Save the file, cheque it in and publish it equally a major version.

That'due south it, y'all are good to go! Your site collection is now being tracked by Google Analytics.

If you take multiple site collections and don't yous want to open SharePoint Designer for each site collection, to edit the JavaScript file, yous tin use my SharePoint WSP Repackage tool to change the solution and create your own unique WSP with your Runway ID.

How to deactivate Google Analytics tracking

If you want to end tracking a specific site collection do the following:

  1. On your site drove root site and get to Settings Site Settings Site Drove Features
  2. Locate the Google Analytics feature and deactivate information technology

    Add JavaScript File

Conclusion

In this article, you have learned how to add Google Analytics to SharePoint without editing the master pages and too how to create a script link custom activity.

If the chief folio was blocking the analytics adoption in your visitor either because you are on SharePoint Online or considering y'all don't want to break your beautiful custom chief pages, this is the mode to go.

Unfortunately, this solution will not work on the new Team Sites and Document Libraries on SharePoint Online because for now, there are no script sites available. As soon every bit something comes out to back up those sites I'll review this commodity once more.

As always the source code of this project is available on my personal GitHub repository and yous can download the WSP solution from this article, the links are down below.

Download Google Analytics WSP

Explore Solution on GitHub


João Ferreira
João Ferreira

How To Download Master Page Sharepoint 365,

Source: https://bindtuning.com/resources/blog/add-google-analytics-sharepoint-without-modifying-master-page

Posted by: heathhounsile.blogspot.com

0 Response to "How To Download Master Page Sharepoint 365"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel