When adding leads using the API (including Zapier), or when posting to a Native Form endpoint directly without using our Native Form Capture code, you must provide the Tracking ID in order to establish a tracked device for the lead. This article will cover several different methods of retrieving this ID.
Method 1 - Dynamic Page Content
To get the ID using our Dynamic Page Content feature, you can simply add the following code beneath your page tracking code.
That will result in the variable SharpSpringTracking containing the tracking ID. You can then use that in your own code to place the tracking ID where needed.
Method 2 - PHP
The following code will fetch the cookie value in PHP:
That results in the variable $SharpSpringTracking containing the cookie value.
Once putting that into place, you can call the function for the SharpSpring cookie like this:
SharpSpringTracking = getCookie(__ss_tk);
That results in the variable SharpSpringTracking having the cookie value.
Once you have the cookie assigned to a variable, you can then write code to pass it on to us. That may involve writing it to a hidden field on the form, or adding it to information being passed to an API call, which will be up to your developer to determine once the cookie has been fetched.
The SharpSpring cookie should have a value with the following format: