Appendix

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Altocloud Developer's Guide for version Current of Altocloud.

Read about miscellaneous topics related to the Altocloud SDK including how the tracking snippet works and the cookies that Altocloud uses.

Retrieve visitor information

Use the Visit API and Customer API to retrieve visitor information.

Visit API

Name Description
ac('api.visit.get', callback) Performs an AJAX request to retrieve the session data from the Altocloud server. The object returned contains the most up-to-date data for the session. This is useful for monitoring live data, such as segment assigned IDs, outcome score progress, and last page viewed.
ac('api.visit.cached', callback) Retrieves the cached Altocloud session data from the browser local storage. If session data does not exist in local storage, a session will be requested via an AJAX request from Altocloud. This is practical for retrieving data that doesn't change for a session, such as the visit identifier, device details, location, referrer, and marketing campaign information.
ac('api.visit.getShortId', callback) This provides the same functionality as 'api.visit.cached', but only the 'shortId' is returned. The short ID is useful as a legible reference number that can be displayed on the website.

Customer API

Name Description
ac('api.customer.get', callback) This performs an AJAX request to retrieve the visitor data from the Altocloud server.

Exclude URL query parameters

Websites often use URL query parameters that are not relevant; they do not influence the content that is shown to the user. For example, in web analytics, parameters such as session IDs, campaign IDs, and so on are not informative. We recommend that you use the Altocloud SDK to exclude these query parameters when you register unique page views. Excluded query parameters are not tracked and are not included in the analytics reports.

Important
Be careful when you exclude parameters. For example, if you want to know which products visitors view on your site, do not exclude a query string parameter for a product ID.

To configure Altocloud to skip certain query parameters, login as an administrator, go to Settings > Tracking Settings and enter a comma-separated list of the unwanted parameters in the Exclude URL Query Parameters field (for example: sessionid,var1,var2).

Track the #hash portion of the URL fragment

By default, Altocloud removes the fragment #hash part of the URL. However, you may want to track the URL fragment to analyze relevant information that it contains.

To include the URL fragments in the URLs tracked, login as an administrator, go to Settings > Tracking Settings and enable/disable the Keep Page URL fragments setting.

Before you enable this setting, beware that - by default - pageviews are recorded on page load. If your website renders different content based on the URL fragment (without issuing a page reload) and you want to track these interactions as individual pageviews, you must call the ac('pageview') method each time the URL fragment changes, passing in the desired page location.

Use the page's canonical URL

Canonical URLs help webmasters and site administrators eliminate duplicate content from analytics reports. For example

http://www.example.com/blog

would be treated as a different page to

http://www.example.com/blog?sidebar=0

even though those URLs display the same content. The side-affect of this is that one page view to each page will be reported instead of two pageviews to a single page.

The canonical URL of a page is often specified in a canonical link element, which can be inserted into the section of a web page. For example:

<link rel="canonical" href="http://example.com/blog" />

To use your canonical URLs and override the URL that the ac SDK will track, configure the init call to use the canonical link element value when available.

ac('init', 'YOUR-ORGANIZATION-ID', {
  region: 'YOUR-REGION',
  canonicalLink: true
});

Integrate with external system

You choose where and how to display the visit’s short ID to your visitors, which you may retrieve programmatically together with other visit data with the following code:

ac('api.visit.getShortId', function (shortId) {
  console.log('Visit short ID is: ' + shortId);
});