Sites

Retrieve sites

GETaccount/sites

Retrieves a list of all the projects/sites that this account either owns or has been granted shared access to.

Query String Parameters

presenter

StringDefault Value: grouped

Accepted values: grouped, flat

Modifies the response data structure

  • grouped: A list of sites grouped by ownership
  • flat: A list of all accessible sites

Definition

GET https://api.gosquared.com/account/v1/sites

Example Request

require_once('gosquared-php-sdk/main.php');

$GS = new GoSquared(array(
  'site_token' => 'GSN-106863-S',
  'api_key' => 'demo'
));

$result = $GS->account->sites();

Live Responseundefined undefined

Your API Key is not authorised for this endpoint

Please fill in the required fields in the Query Builder

Add a site

POSTaccount/sites

Adds a new site to GoSquared tracking. This endpoint allows the programmatic creation of sites to be tracked with GoSquared. It is important to note that this does not mean the site is now being tracked. You must still include our tracking code, or use one of our client libraries, to track information from the added site.

The response body will contain the details for the created including its site_token. This site_token can then be used as part of you application flow to enable tracking on the added site.

POST Body

name

String

The name of the site

url

StringRequired

A valid http(s) url

timezone

StringDefault Value: Europe/London

A valid timezone

Accepted values: Africa/Algiers, Atlantic/Cape_Verde, Africa/Ndjamena, Africa/Abidjan, Africa/Bamako, Africa/Banjul, Africa/Conakry, Africa/Dakar, Africa/Freetown, Africa/Lome, Africa/Nouakchott, Africa/Ouagadougou, Africa/Sao_Tome, Atlantic/St_Helena, Africa/Cairo, Africa/Accra, Africa/Bissau, Africa/Nairobi, Africa/Addis_Ababa, Africa/Asmara, Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala, Africa/Mogadishu, Indian/Antananarivo, Indian/Comoro, Indian/Mayotte, Africa/Monrovia, Africa/Tripoli, Indian/Mauritius, Africa/Casablanca, Africa/El_Aaiun, Africa/Maputo, Africa/Blantyre, Africa/Bujumbura, Africa/Gaborone, Africa/Harare, Africa/Kigali, Africa/Lubumbashi, Africa/Lusaka, Africa/Windhoek, Africa/Lagos, Africa/Bangui, Africa/Brazzaville, Africa/Douala, Africa/Kinshasa, Africa/Libreville, Africa/Luanda, Africa/Malabo, Africa/Niamey, Africa/Porto-Novo, Indian/Reunion, Indian/Mahe, Africa/Johannesburg, Africa/Maseru, Africa/Mbabane, Africa/Khartoum, Africa/Juba, Africa/Tunis, Antarctica/Casey, Antarctica/Davis, Antarctica/Mawson, Indian/Kerguelen, Antarctica/DumontDUrville, Antarctica/Syowa, Antarctica/Troll, Antarctica/Vostok, Antarctica/Rothera, Asia/Kabul, Asia/Yerevan, Asia/Baku, Asia/Dhaka, Asia/Thimphu, Indian/Chagos, Asia/Brunei, Asia/Rangoon, Asia/Shanghai, Asia/Urumqi, Asia/Hong_Kong, Asia/Taipei, Asia/Macau, Asia/Nicosia, Asia/Tbilisi, Asia/Dili, Asia/Kolkata, Asia/Jakarta, Asia/Pontianak, Asia/Makassar, Asia/Jayapura, Asia/Tehran, Asia/Baghdad, Asia/Jerusalem, Asia/Tokyo, Asia/Amman, Asia/Almaty, Asia/Qyzylorda, Asia/Aqtobe, Asia/Aqtau, Asia/Oral, Asia/Bishkek, Asia/Seoul, Asia/Pyongyang, Asia/Beirut, Asia/Kuala_Lumpur, Asia/Kuching, Indian/Maldives, Asia/Hovd, Asia/Ulaanbaatar, Asia/Choibalsan, Asia/Kathmandu, Asia/Karachi, Asia/Gaza, Asia/Hebron, Asia/Manila, Asia/Qatar, Asia/Bahrain, Asia/Riyadh, Asia/Aden, Asia/Kuwait, Asia/Singapore, Asia/Colombo, Asia/Damascus, Asia/Dushanbe, Asia/Bangkok, Asia/Phnom_Penh, Asia/Vientiane, Asia/Ashgabat, Asia/Dubai, Asia/Muscat, Asia/Samarkand, Asia/Tashkent, Asia/Ho_Chi_Minh, Australia/Darwin, Australia/Perth, Australia/Eucla, Australia/Brisbane, Australia/Lindeman, Australia/Adelaide, Australia/Hobart, Australia/Currie, Australia/Melbourne, Australia/Sydney, Australia/Broken_Hill, Australia/Lord_Howe, Antarctica/Macquarie, Indian/Christmas, Indian/Cocos, Pacific/Fiji, Pacific/Gambier, Pacific/Marquesas, Pacific/Tahiti, Pacific/Guam, Pacific/Saipan, Pacific/Tarawa, Pacific/Enderbury, Pacific/Kiritimati, Pacific/Majuro, Pacific/Kwajalein, Pacific/Chuuk, Pacific/Pohnpei, Pacific/Kosrae, Pacific/Nauru, Pacific/Noumea, Pacific/Auckland, Pacific/Chatham, Antarctica/McMurdo, Pacific/Rarotonga, Pacific/Niue, Pacific/Norfolk, Pacific/Palau, Pacific/Port_Moresby, Pacific/Bougainville, Pacific/Pitcairn, Pacific/Pago_Pago, Pacific/Midway, Pacific/Apia, Pacific/Guadalcanal, Pacific/Fakaofo, Pacific/Tongatapu, Pacific/Funafuti, Pacific/Wake, Pacific/Efate, Pacific/Wallis, Europe/London, Europe/Jersey, Europe/Guernsey, Europe/Isle_of_Man, Europe/Dublin, Europe/Tirane, Europe/Andorra, Europe/Vienna, Europe/Minsk, Europe/Brussels, Europe/Sofia, Europe/Prague, Europe/Copenhagen, Atlantic/Faroe, America/Danmarkshavn, America/Scoresbysund, America/Godthab, America/Thule, Europe/Tallinn, Europe/Helsinki, Europe/Mariehamn, Europe/Paris, Europe/Berlin, Europe/Busingen, Europe/Gibraltar, Europe/Athens, Europe/Budapest, Atlantic/Reykjavik, Europe/Rome, Europe/Vatican, Europe/San_Marino, Europe/Riga, Europe/Vaduz, Europe/Vilnius, Europe/Luxembourg, Europe/Malta, Europe/Chisinau, Europe/Monaco, Europe/Amsterdam, Europe/Oslo, Arctic/Longyearbyen, Europe/Warsaw, Europe/Lisbon, Atlantic/Azores, Atlantic/Madeira, Europe/Bucharest, Europe/Kaliningrad, Europe/Moscow, Europe/Simferopol, Europe/Volgograd, Europe/Samara, Asia/Yekaterinburg, Asia/Omsk, Asia/Novosibirsk, Asia/Novokuznetsk, Asia/Krasnoyarsk, Asia/Irkutsk, Asia/Chita, Asia/Yakutsk, Asia/Vladivostok, Asia/Khandyga, Asia/Sakhalin, Asia/Magadan, Asia/Srednekolymsk, Asia/Ust-Nera, Asia/Kamchatka, Asia/Anadyr, Europe/Belgrade, Europe/Ljubljana, Europe/Podgorica, Europe/Sarajevo, Europe/Skopje, Europe/Zagreb, Europe/Bratislava, Europe/Madrid, Africa/Ceuta, Atlantic/Canary, Europe/Stockholm, Europe/Zurich, Europe/Istanbul, Europe/Kiev, Europe/Uzhgorod, Europe/Zaporozhye, America/New_York, America/Chicago, America/North_Dakota/Center, America/North_Dakota/New_Salem, America/North_Dakota/Beulah, America/Denver, America/Los_Angeles, America/Juneau, America/Sitka, America/Metlakatla, America/Yakutat, America/Anchorage, America/Nome, America/Adak, Pacific/Honolulu, Pacific/Johnston, America/Phoenix, America/Boise, America/Indiana/Indianapolis, America/Indiana/Marengo, America/Indiana/Vincennes, America/Indiana/Tell_City, America/Indiana/Petersburg, America/Indiana/Knox, America/Indiana/Winamac, America/Indiana/Vevay, America/Kentucky/Louisville, America/Kentucky/Monticello, America/Detroit, America/Menominee, America/St_Johns, America/Goose_Bay, America/Halifax, America/Glace_Bay, America/Moncton, America/Blanc-Sablon, America/Toronto, America/Thunder_Bay, America/Nipigon, America/Rainy_River, America/Atikokan, America/Winnipeg, America/Regina, America/Swift_Current, America/Edmonton, America/Vancouver, America/Dawson_Creek, America/Creston, America/Pangnirtung, America/Iqaluit, America/Resolute, America/Rankin_Inlet, America/Cambridge_Bay, America/Yellowknife, America/Inuvik, America/Whitehorse, America/Dawson, America/Cancun, America/Merida, America/Matamoros, America/Monterrey, America/Mexico_City, America/Ojinaga, America/Chihuahua, America/Hermosillo, America/Mazatlan, America/Bahia_Banderas, America/Tijuana, America/Santa_Isabel, America/Nassau, America/Barbados, America/Belize, Atlantic/Bermuda, America/Cayman, America/Costa_Rica, America/Havana, America/Santo_Domingo, America/El_Salvador, America/Guatemala, America/Port-au-Prince, America/Tegucigalpa, America/Jamaica, America/Martinique, America/Managua, America/Panama, America/Puerto_Rico, America/Miquelon, America/Grand_Turk, America/Argentina/Buenos_Aires, America/Argentina/Cordoba, America/Argentina/Salta, America/Argentina/Tucuman, America/Argentina/La_Rioja, America/Argentina/San_Juan, America/Argentina/Jujuy, America/Argentina/Catamarca, America/Argentina/Mendoza, America/Argentina/San_Luis, America/Argentina/Rio_Gallegos, America/Argentina/Ushuaia, America/Aruba, America/La_Paz, America/Noronha, America/Belem, America/Santarem, America/Fortaleza, America/Recife, America/Araguaina, America/Maceio, America/Bahia, America/Sao_Paulo, America/Campo_Grande, America/Cuiaba, America/Porto_Velho, America/Boa_Vista, America/Manaus, America/Eirunepe, America/Rio_Branco, America/Santiago, Pacific/Easter, Antarctica/Palmer, America/Bogota, America/Curacao, America/Lower_Princes, America/Kralendijk, America/Guayaquil, Pacific/Galapagos, Atlantic/Stanley, America/Cayenne, America/Guyana, America/Asuncion, America/Lima, Atlantic/South_Georgia, America/Paramaribo, America/Port_of_Spain, America/Anguilla, America/Antigua, America/Dominica, America/Grenada, America/Guadeloupe, America/Marigot, America/Montserrat, America/St_Barthelemy, America/St_Kitts, America/St_Lucia, America/St_Thomas, America/St_Vincent, America/Tortola, America/Montevideo, America/Caracas,

Definition

POST https://api.gosquared.com/account/v1/sites

Example Request

The PHP library does not support this function at this time

Live Responseundefined undefined

Your API Key is not authorised for this endpoint

Retrieve all sites and pageview count

GETaccount/sites/usage

Retrieve all sites and pageview count

Query String Parameters

from

String

The start date-time for the query

to

String

The end date-time for the query

Definition

GET https://api.gosquared.com/account/v1/sites/usage

Example Request

require_once('gosquared-php-sdk/main.php');

$GS = new GoSquared(array(
  'site_token' => 'GSN-106863-S',
  'api_key' => 'demo'
));

$result = $GS->account->sites->usage();

Live Responseundefined undefined

Your API Key is not authorised for this endpoint

Please fill in the required fields in the Query Builder

Retrieve a site

GETaccount/sites/{site_token}

Retrieves the details for site/project by its site_token

Path Parameters

site_token

StringRequired

A valid GoSquared site token

Definition

GET https://api.gosquared.com/account/v1/sites/{site_token}

Example Request

require_once('gosquared-php-sdk/main.php');

$GS = new GoSquared(array(
  'site_token' => 'GSN-106863-S',
  'api_key' => 'demo'
));

$result = $GS->account->sites->{site_token}();

Live Responseundefined undefined

Your API Key is not authorised for this endpoint

Please fill in the required fields in the Query Builder