From 6c45b3677ee06cd58056447a4b7b45fa78df8b74 Mon Sep 17 00:00:00 2001
From: Cho <cho@lindenlab.com>
Date: Sat, 24 Aug 2013 02:15:08 +0100
Subject: added Google Analytics query parameters to URLs for FBC photos and
 checkins for ACME-854

---
 indra/newview/llfloatersocial.cpp | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 4c17d9e40d..2a74c8e3ea 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -55,6 +55,8 @@ static LLRegisterPanelClassWrapper<LLSocialAccountPanel> t_panel_account("llsoci
 const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte
 const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/";
 const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png";
+const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare";
+const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare";
 
 std::string get_map_url()
 {
@@ -345,12 +347,19 @@ void LLSocialPhotoPanel::sendPhoto()
 	bool add_location = mLocationCheckbox->getValue().asBoolean();
 	if (add_location)
 	{
+		// Get the SLURL for the location
 		LLSLURL slurl;
 		LLAgentUI::buildSLURL(slurl);
+		std::string slurl_string = slurl.getSLURLString();
+
+		// Add query parameters so Google Analytics can track incoming clicks!
+		slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS;
+
+		// Add it to the caption (pretty crude, but we don't have a better option with photos)
 		if (caption.empty())
-			caption = slurl.getSLURLString();
+			caption = slurl_string;
 		else
-			caption = caption + " " + slurl.getSLURLString();
+			caption = caption + " " + slurl_string;
 	}
 
 	// Get the image
@@ -592,6 +601,9 @@ void LLSocialCheckinPanel::sendCheckin()
 	{
 		slurl_string = DEFAULT_CHECKIN_LOCATION_URL;
 	}
+
+	// Add query parameters so Google Analytics can track incoming clicks!
+	slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS;
     
 	// Get the region name
 	std::string region_name = gAgent.getRegion()->getName();
-- 
cgit v1.2.3