Get Tracking Code

Tracking code generated for your domain should be embedded in your webpage to begin tracking. Using this API, you can get the tracking code that has to be embedded in a webpage.

Scope required

  • ZohoMarketingAutomation.wa.READ

Header

Authorization: Zoho-oauthtoken <access_token>

Request Type

  • GET

Request URL

https://marketingautomation.zoho.com/api/v1/domains/<key>/code

Note:

  • key - Provide your domain key obtained at time of domain creation.

API Limit

  • Duration: 1 min
  • Number of Calls: 100
  • Lock Period: 5 mins

You can send 100 API calls per minute. If you hit this limit, you can't use this API for the next 5 minutes due to security reasons, but you can still use other APIs if their lock period hasn’t been reached.

Possible error cases

Error codeDescription
7701Domain is not configured.
900Mandatory parameters are missing.
7703Domain name already exists
7704No domains found in this account.

If your error code is not listed above, click here.

Sample request

Copiedhttps://marketingautomation.zoho.com/api/v1/domains/29bb77af841821fa756febfd0cb811b03/code

Sample Response

Copied{
    "domain_name": "zylker.com",
    "code": 200,
    "domain_status": "Active",
    "tracking_script": "<script>var w=window;var p = w.location.protocol;if(p.indexOf('http') < 0){p = 'http'+':';}var d = document;var f = d.getElementsByTagName('script')[0],s = d.createElement('script');s.type = 'text/javascript'; s.async = false; if (s.readyState){s.onreadystatechange = function(){if (s.readyState=='loaded'||s.readyState == 'complete'){s.onreadystatechange = null;try{loadwaprops('281c951a2c1770adc1f0db88921e34a27','22dcd732b20c75fcc','29bb77af841821fa71f0db88921e34a27','2a592fc1883f349c16a73058460b2a736',0.0);}catch(e){}}};}else {s.onload = function(){try{loadwaprops('281c951a2c1770adc1f0db88921e34a27','22dcd732b20c75fcc','29bb77af841821fa71f0db88921e34a27','2a592fc1883f349c16a73058460b2a736',0.0);}catch(e){}};};s.src ='http://satheesh-4986.csez.zohocorpin.com:8081/js/WebsiteAutomation.js'; f.parentNode.insertBefore(s, f);</script>",
    "uri": "/api/v1/domains/29bb77af841821fa756febfd0cb811b03/code",
    "version": "1"
}