Add google analytics to SharePoint, SharePoint 2013 and SharePoint online (Office 365)

Intro

Google ana­lyt­ics can pro­vide a very con­cise overview on how your web­site is doing. It gen­er­ates nice reports and hosts clear reports.

It is also pos­si­ble to use google ana­lyt­ics to track usage on an intranet site built on Share­Point, Share­Point 2013 or Share­Point online.

In this tuto­r­i­al i will explain the steps to imple­ment ana­lyt­ics to your Share­Point site.

 

Prerequisites:

  1. You need a google account
  2. You need per­mis­sions to edit (master)pages in Share­Point

Steps

In short:

  1. go to google.com/analytics to gen­er­ate an ana­lyt­ic­sID
  2. copy some code to the site you’d like to track

Not so short:

  • go to http://google.com/analytics
  • Cre­ate an account (see this as a group for the sites you track)
  • Add a new prop­er­ty (a new site to track)

google analytics

  • Retrieve the track­ing-ID
  • Select the script pro­vid­ed (start at <script> and copy includ­ing </script>)
  • trackingID code
  • Open Share­Point design­er and nav­i­gate to the mas­ter­page fold­er.
  • Open the mas­ter­page you are using for your intranet (in my case its Seat­tle)
  • Open and edit the .html ver­sion (the .aspx will be mod­i­fied by Share­Point after edit­ing)
  • scroll all the way to the bot­tom and look for the tag </body>find body tag
  • past the ana­lyt­ics code just above the </body> tag past analytics code
  • save the mas­ter­page

Now the track­ing data will be sent to google ana­lyt­ics. It may take some time before the results start to roll in but they will.

 

first resultsFirst results com­ing in after just a minute.

 

 

Why the SharePoint 2013 search results web part is not showing all results

Why the SharePoint 2013 search results web part is not showing all results

I added the search results webart to my team­site in order to cre­ate a dynam­ic list with all sub­sites. But the strange thing I noticed was that when build­ing the query the search results pre­view was show­ing all sub­sites, and after i added the web­part to my site it didn’t any­more. It only showed a cou­ple.

The rea­son this hap­pens is because Share­Point 2013 search is trim­ming the search results. In this case it finds a cou­ple of results that are quite sim­i­lar and by default dupli­cates are fil­tered out of the result set.

You can view dupli­cates but you’d have to hov­er over a search result that in fact has a dupli­cate.

In the next screen­shots i will explain what hap­pened and how i fixed it.

Search results query webpart with preview

Webpart showing only two results instead of four

The fix

We need to change the TrimDu­pli­cates para­me­ter and set it to false. Unfor­tu­nate­ly it is not a set­ting in the Edit Web Part prop­er­ties pane. So we will have to down­load the web part and change the para­me­ter using an edi­tor.

Edit the web part

Find TrimDu­pli­cates and change it’s val­ue from true to false.

Search Results.webpart

Save the file and rename it if you like.

Upload the edited web part

Add the web part to the site

After you’ve uploaded the new web part it’ll show up in the list under Import­ed Web Parts

Fixed it!

Hide the Recent tab in SharePoint Navigation

I have nev­er liked the “Recent” tab in the Share­Point Quick­Start nav­i­ga­tion.

Hide Recent 1

So here is a way to hide it for­ev­er! We do this by edit­ing the prop­er­ties of the link in the nav­i­ga­tion set­tings of the site. We will dis­play the link to all mem­bers of a new­ly cre­at­ed group. The thing is that there are no mem­bers in that group (oth­er than the farm admin­is­tra­tor of course).

 

Step 1

Go into Site set­tings.

Hide Recent 2

Step 2

Open Peo­ple and groups to cre­ate a new group

Hide Recent 3

 

Step 3

Switch the view to Groups

Hide Recent 4

 

Step 4

Click “New” to cre­at the new group.

Hide Recent 5

 

 

Step 5

Give the new group a name and enter a descrip­tion.

Hide Recent 6

Should­n’t it say Group Descrip­tion or some­thing?

Leave all set­tings default and click “Cre­ate”.

Step 6

Delete your­self from the group

Hide Recent 8

If you cre­at­ed the group logged in with the sys­tem admin­is­tra­tive account the group will be emp­ty. 

 

Step 7

Go into Site set­tings and Nav­i­ga­tion

Hide Recent 9

And scroll down to Struc­tur­al nav­i­ga­tion

Step 8

Select the Recent head­ing and click on “Edit”

Hide Recent 10

 

Step 9

Edit the prop­er­ties for this Head­ing.

Find the new­ly cre­at­ed group by click­ing on the address book.

Hide Recent 11

Select “Share­Point Groups”

Hide Recent 12

Search, select, add and hit “OK

Hide Recent 13

 

If all went well you should see this screen. Just click “OK

Hide Recent 14

And now the Recent head­ing will be hid­den.

Hide Recent 15

Add extra result types and properties to the advanced search page

Step 1

First open the advanced search page.
This page can be found at <sitecollection>/search/advanced.aspx Result types 1

Step 2

Edit the page

Result types 2

Step 3

Edit the web­part

Result types 3

Step 4

Open the builder win­dow to edit prop­er­ties

Result types 4

Step 5

Once in the builder win­dow, select all con­tents by hit­ting CTRL‑A and copy it with CRTL‑C Result types 5

Step 6

Open Visu­al Stu­dio (or any oth­er edi­tor) and cre­ate a new XML file. We are not going to save this file but past­ing it into visu­al stu­dio for­mats the text so it is out­lined prop­er­ly. Result types 6

Step 7

Remove the default head­er. (CTRL‑A and DEL)

Result types 7

Step 8

And paste the XML from the web­part Result types 8

Looks much bet­ter does­n’t it?

Step 9

First we’ll cre­ate a new Result­Type Select the “Doc­u­ments” Result­Type. Copy and past it at the end of the Result­Types sec­tion.

Result types 9

Step 10

Rename “Doc­u­ments”. In this case we are going to use “Man­u­scripts” Result types 10

Step 11

Next we’ll cre­ate a new prop­er­ty def­i­n­i­tion Result types 11

Step 12

Add the new Prop­er­ty Def­i­n­i­tion to the new Result­Type Result types 12

Step 13

Copy all text and paste it back into the Builder win­dow in Share­Point Result types 13 And click OK

Step 14

Click OK to save the changes to the Web­part and save the page.

Result types 14

Don’t for­get to check in and pub­lish the page.

Et voila!

Result types 15

SharePoint 2013 Crawl job will not stop

When you are unable to stop a crawl (full or incre­men­tal) using the cen­tral admin, you can try these addi­tion­al steps.

  1. Stop and start the Share­Point Serv­er Search 15 ser­vice
    1. Do this by going into services.msc (Hit Win­dows, R and type services.msc)
    2. Find the ser­vice and hit restart
  2. Run this pow­er­shell script on your Share­Point serv­er

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

Get-SPEn­ter­pris­eSearchCrawl­Con­tentSource ‑SearchAp­pli­ca­tion “Search Ser­vice App” | ForE­ach-Object {
if ($.Crawl­Sta­tus ‑ne “Idle”)
{
Write-Host “Stop­ping cur­rent­ly run­ning crawl for con­tent source $($
.Name)…”
$.StopCrawl()
do { Start-Sleep ‑Sec­onds 1 }
while ($
.Crawl­Sta­tus ‑ne “Idle”)
}
Write-Host “Start­ing full crawl for con­tent source $($.Name)…”
$
.Start­Full­Crawl()
}

This should get things going again. ​

SharePoint 2013 Search — Create new managed property

In this tuto­r­i­al I will explain how to cre­ate a Man­aged Prop­er­ty. Once cre­at­ed you can uti­lize them in search as refin­ers, search prop­er­ties and more.

Let’s say i want to cre­ate a man­aged prop­er­ty from a list col­umn called: Events & Jour­nals

#Step 1
Because the col­umn name has a & sign in the name i will first have to deter­mine the sys­tem name of this col­umn.
To do that go to the list set­tings and edit the desired col­umn. In the URL you can see what the inter­nal sys­tem name for this col­umn is. In our case it is: Events_x0020_journals.

Lookup Column name

 

#Step 2

Open up Share­Point Cen­tral Admin and go to the Man­age ser­vice appli­ca­tions page.

Go to Manage service applications

 

#Step 3

Open the Search Ser­vice Appli­ca­tion page

Open search service application

 

#Step 4

Man­aged prop­er­ties can be found in the Search Schema sec­tion

Search Schema section

 

#Step 5

First lookup the name for the list col­umn. This will have the pre­fix of ows_
Click on Crawled Prop­er­ties then enter the name (or a part of the name) of the col­umn and hit Enter. You can see that the col­umn is found and that the name is: ows_Events_x0020_Journals. 

Click­ing on Man­aged Prop­er­ties will take you to the screen where you can cre­ate a new one.

Lookup the proper tie name

 

#Step 6

Click on New Man­aged Prop­er­ty

Click new managed property

 

#Step 7

Enter a name for the new prop­er­ty, select the type and check the box­es for the main char­ac­ter­is­tics.

New managed property

 

Read the text next to the check­box­es to help you decide if you need that func­tion­al­i­ty.

#Step 8

Scroll down to Map­pings to add a map­ping to for this new prop­er­ty.

New mapping

 

#Step 9

First enter the col­umn name we found in step 1, then click find. Select the right prop­er­ty and hit OK.

Select crawled property

 

 

This will cre­ate the new Man­aged Prop­er­ty

#Step 10

Type the name in the Fil­ter field and hit Enter to check if the prop­er­ty exists.

Check for existence

 

#Step 11

To wrap things up you will have to start a full crawl before the new Man­aged Prop­er­ty is avail­able. Goto the Con­tent Sources and click on Start Full Crawl in the drop down menu for the con­tent source where you want to use the new Man­aged Prop­er­ty.

 

#That’s it.

Hap­py search­ing.

 

In this post you can read how to uti­lize the Man­aged prop­er­ty in the advanced search page.

SharePoint 2013 Search. Add extra result types and properties to the advanced search page

Step 1

First open the advanced search page.
This page can be found at /search/advanced.aspx

First-open-the-advanced-search-page-This-page-can-be-found-at--search-advancedaspx

Step 2

Edit the page

Edit-the-page

Step 3

Edit the web­part

Edit-the-webpart

 

Step 4

Open the builder win­dow to edit prop­er­ties

Open-the-builder-window-to-edit-properties

 

Step 5

Once in the builder win­dow, select all con­tents by hit­ting CTRL‑A and copy it with CRTL‑C

Once-in-the-builder-window--select-all-contents-by-hitting-CTRL-A-and-copy-it-with-CRTL-C

 

Step 6

Open Visu­al Stu­dio (or any oth­er edi­tor) and cre­ate a new XML file.

We are not going to save this file but past­ing it into visu­al stu­dio for­mats the text so it is out­lined prop­er­ly.

Open-Visual-Studio--or-any-other-editor--and-create-a-new-XML-file

 

Step 7

Remove the default head­er. (CTRL‑A and DEL)

Remove-the-default-header--CTRL-A-and-DEL-

 

Step 8

And paste the XML from the web­part

And-paste-the-XML-from-the-webpart

Looks much bet­ter does­n’t it?

Step 9

First we’ll cre­ate a new Result­Type

Select the “Doc­u­ments” Result­Type. Copy and past it at the end of the Result­Types sec­tion.

First-we-ll-create-a-new-ResultType

 

Step 10

Rename “Doc­u­ments”. In this case we are going to use “Man­u­scripts”

Rename--Documents--In-this-case-we-are-going-to-use--Manuscripts-

 

Step 11

Next we’ll cre­ate a new prop­er­ty def­i­n­i­tion

Next-we-ll-create-a-new-property-definition

 

Step 12

Add the new Prop­er­ty Def­i­n­i­tion to the new Result­Type

Add-the-new-Property-Definition-to-the-new-ResultType

 

Step 13

Copy all text and paste it back into the Builder win­dow in Share­Point

Copy-all-text-and-paste-it-back-into-the-Builder-window-in-SharePoint

And click OK

Step 14

Click OK to save the changes to the Web­part and save the page.

Click-OK-to-save-the-changes-to-the-Webpart-and-save-the-page

Don’t for­get to check in and pub­lish the page.

Et voila!

Et-voila-

Workflow will not start. The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service.

Problem:

A work­flow that is cre­at­ed with Share­Point Design­er can­not be start­ed.
The fol­low­ing error appears:

Error: The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service. For more information, contact your server administrator.

Reason:

The startscreen for the work­flow, which is actu­al­ly an InfoPath form, can­not be dis­played. This is because the State Ser­vice is not installed or is not active.

Resloution:

Start a Share­Point 2013 Man­age­ment Shell ses­sion and enter these com­mands to set­up a State Ser­vice.
$ss = New-SPStateServiceApplication -Name "State Service"
New-SPStateServiceDatabase -Name "WSS_StateService" -ServiceApplication $ss
New-SPStateServiceApplicationProxy -Name "State Service Proxy" -ServiceApplication $ss –DefaultProxyGroup

Getting: Microsoft.AnalysisServices.SPAddin.ReportGallery.ReportGalleryView when creating a PowerPivot Gallery in SharePoint 2013

If you get this mes­sage Microsoft.AnalysisServices.SPAddin.ReportGallery.ReportGalleryView when you try to cre­ate a Pow­er­Piv­ot Gallery here’s what you should do.

Deploy powerpivotwebapplicationsolution.wsp to your web app

To do this you go into the cen­tral admin, man­age farm solu­tions. You can find it under Sys­tem set­tings. There you can deploy the solu­tion to your web app.  (it is prob­a­bly only deployed to the cen­tral admin web app)

 

Good luck!