이 플러그인은 Adobe Analytics를 최대한 활용할 수 있도록 Adobe Consulting에서 무료로 제공합니다. Adobe 고객 지원 센터는 설치 또는 문제 해결 등 본 플러그인에 대한 지원을 제공하지 않습니다. 본 플러그인에 대한 도움이 필요한 경우 조직의 Adobe 계정 팀에 문의하십시오. 계정 팀이 컨설턴트와의 미팅을 조정할 수 있습니다.
getGeoCoordinates
플러그인을 사용하면 방문자 디바이스의 위도와 경도를 캡처할 수 있습니다. Analytics 변수에서 지리적 위치 데이터를 캡처하려면 이 플러그인을 사용하는 것이 좋습니다.
Adobe은 Web SDK에서 가장 일반적으로 사용되는 플러그인을 사용할 수 있도록 해주는 확장을 제공합니다.
getGeoCoordinates
이 플러그인은 아직 웹 SDK의 수동 구현 내에서 사용할 수 없습니다.
Adobe은 Adobe Analytics에서 가장 일반적으로 사용되는 플러그인을 사용할 수 있도록 해주는 확장을 제공합니다.
일반 Analytics 플러그인 확장 프로그램을 사용하지 않으려는 경우 사용자 지정 코드 편집기를 사용할 수 있습니다.
Analytics 추적 오브젝트가 인스턴스화 (s_gi
사용)된 후 AppMeasurement 파일의 아무 곳에나 다음 코드를 복사하여 붙여넣으십시오. 구현에서 코드의 댓글 및 버전 번호를 보존하면 Adobe에서 잠재적인 문제를 해결하는 데 도움이 됩니다.
/******************************************* BEGIN CODE TO DEPLOY *******************************************/
/* Adobe Consulting Plugin: getGeoCoordinates v2.0 */
function getGeoCoordinates(){if(arguments&&"-v"===arguments[0])return{plugin:"getGeoCoordinates",version:"2.0"};var b=function(){if("undefined"!==typeof window.s_c_il)for(var a=0,c;a<window.s_c_il.length;a++)if(c=window.s_c_il[a],c._c&&"s_c"===c._c)return c}();"undefined"!==typeof b&&(b.contextData.getGeoCoordinates="2.0");window.cookieWrite=window.cookieWrite||function(a,c,f){if("string"===typeof a){var h=window.location.hostname,b=window.location.hostname.split(".").length-1;if(h&&!/^[0-9.]+$/.test(h)){b=2<b?b:2;var e=h.lastIndexOf(".");if(0<=e){for(;0<=e&&1<b;)e=h.lastIndexOf(".",e-1),b--;e=0<e?h.substring(e):h}}g=e;c="undefined"!==typeof c?""+c:"";if(f||""===c)if(""===c&&(f=-60),"number"===typeof f){var d=new Date;d.setTime(d.getTime()+6E4*f)}else d=f;return a&&(document.cookie=encodeURIComponent(a)+"="+encodeURIComponent(c)+"; path=/;"+(f?" expires="+d.toUTCString()+";":"")+(g?" domain="+g+";":""),"undefined"!==typeof cookieRead)?cookieRead(a)===c:!1}};window.cookieRead=window.cookieRead||function(a){if("string"===typeof a)a=encodeURIComponent(a);else return"";var c=" "+document.cookie,b=c.indexOf(" "+a+"="),d=0>b?b:c.indexOf(";",b);return(a=0>b?"":decodeURIComponent(c.substring(b+2+a.length,0>d?c.length:d)))?a:""};var d="";b=cookieRead("s_ggc").split("|");var k={timeout:5E3,maximumAge:0},l=function(a){a=a.coords;cookieWrite("s_ggc",parseFloat(a.latitude.toFixed(4))+"|"+parseFloat(a.longitude.toFixed(4)),30);d="latitude="+parseFloat(a.latitude.toFixed(4))+" | longitude="+parseFloat(a.longitude.toFixed(4))},m=function(a){d="error retrieving geo coordinates"};1<b.length&&(d="latitude="+b[0]+" | longitude="+b[1]);navigator.geolocation&&navigator.geolocation.getCurrentPosition(l,m,k);""===d&&(d="geo coordinates not available");return d};
/******************************************** END CODE TO DEPLOY ********************************************/
getGeoCoordinates
함수는 인수를 사용하지 않습니다. 다음 값 중 하나를 반환합니다.
"geo coordinates not available"
: 플러그인이 실행되는 시점에 사용할 수 있는 지리적 위치 데이터가 없는 디바이스의 경우. 이 값은 방문의 첫 번째 히트에서 일반적입니다. 특히 방문자가 위치 추적에 대해 먼저 동의해야 할 때 사용됩니다."error retrieving geo coordinates"
: 디바이스의 위치를 검색하려고 할 때 플러그인에 오류가 발생하는 경우."latitude=[LATITUDE] | longtitude=[LONGITUDE]"
: 여기서 [LATITUDE]/[LONGITUDE]는 각각 위도와 경도입니다.좌표 값은 가장 가까운 소수 넷째 자리로 반올림됩니다. 예를 들어 "40.438635333"
이라는 값은 캡처할 고유 값들의 개수를 제한하기 위해 "40.4386"
으로 반올림됩니다. 이러한 값은 약 20피트 내에서 디바이스의 정확한 위치를 찾아낼 수 있을 만큼 가깝습니다.
이 플러그인은 필요한 경우 "s_ggc"
라는 쿠키를 사용하여 히트 간 좌표를 저장합니다.
// Sets eVar1 to one of the above return values depending on the visitor's device status.
s.eVar1 = getGeoCoordinates();
// Extracts latitude and longitude into their own variables called finalLatitude and finalLongitude for use in other code/applications.
var coordinates = getGeoCoordinates();
if(coordinates.indexOf("latitude") > -1)
{
var finalLatitude = Number(coordinates.split("|")[0].trim().split("=")[1]),
finalLongitude = Number(coordinates.split("|")[1].trim().split("=")[1]);
}
// From there, you can determine whether a visitor is at, for example, the Statue of Liberty:
if(finalLatitude >= 40.6891 && finalLatitude <= 40.6893 && finalLongitude >= -74.0446 && finalLongitude <= -74.0444)
{
var visitorAtStatueOfLiberty = true;
}
else
{
var visitorAtStatueOfLiberty = false;
}