Need help?

Google analytics

The hosted payment pages can use the Google Analytics Measurement Protocol to send information on customer progress through the payment pages. You will need to provide your tracker ID, the customers Client ID, and details of the domain you want to record the events under.

FieldDescriptionNotes
tidTracker IDYour Google Analytics tracker ID
cidClient IDThe customer's client ID
dhYour hostnameNo protocol (such as http: etc), just the domain (e.g. www.site.com)
dpDocument pathThis will be used as a prefix to the path sent at each stage. It must start with '/'
dsData sourceOptional. If not set, then 'web' will be used.
cnCampaign nameOptional fields to allow you to specify any required campaign tracking values.
csCampaign sourceOptional fields to allow you to specify any required campaign tracking values.
cmCampaign mediumOptional fields to allow you to specify any required campaign tracking values.
ckCampaign keywordOptional fields to allow you to specify any required campaign tracking values.
ccCampaign contentOptional fields to allow you to specify any required campaign tracking values.
ciCampaign IDOptional fields to allow you to specify any required campaign tracking values.
gclidAdWords ID
dclidDisplay Ads ID

The URL sent for each payment stage is constructed by adding the following to the value in ’dp’

URLDescription
/telr/data_entry.htmlInitial Data Entry
/telr/service_out.htmlRedirect to service provider
/telr/service_back.htmlReturn from service provider
/telr/mpi_check.html3D-Secure Enrolment Check
/telr/acs_out.htmlRedirect to card issuer (3D Secure)
/telr/acs_back.htmlReturn from card issuer (3D Secure)
/telr/card_auth.htmlCard authorisation request
/telr/authorised.htmlTransaction authorised
/telr/declined.htmlTransaction declined
/telr/cancelled.htmlTransaction cancelled

If you have set ‘ga_dp’ to a value such as ‘/payments’ then the URLs sent to the analytics system would be ‘/payments/telr/data_entry.html’, ‘/payments/telr/mpi_check.html’ and so on.

Example

{
  "method": "create",
  "store": 15996,
  "authkey": "mykey1234",
  "order": {
    "cartid": "1234",
    "test": "1",
    "amount": "10.50",
    "currency": "AED",
    "description": "My purchase"
  },
  "return": {
    "authorised": "https://www.mysite.com/authorised",
    "declined": "https://www.mysite.com/declined",
    "cancelled": "https://www.mysite.com/cancelled"
  },
  "ga": {
		"tid": "xxx",
		"cid": "xxx",
		"dh": "xxx",
		"dp": "xxx",
		"ds": "xxx",
		"cn": "xxx",
		"cs": "xxx",
		"cm": "xxx",
		"ck": "xxx",
		"cc": "xxx",
		"ci": "xxx",
		"gclid": "xxx",
		"dclid": "xxx"
	}
}

Obtaining the client ID

You will need to get the client ID from the Google Analytics code you are operating on your site prior to sending the transaction request. If you are using the analytics.js method, then you can use the following code on your page to retrieve the client ID:

ga(function(tracker) {  
  var clientId = tracker.get('clientId');  
});

See https://developers.google.com/analytics/devguides/collection/analyticsjs/domains#getClientId for more details.