Difference between revisions of "Functions:TEMChannelTag"
From Whirlwind eCommerce Wiki
(created...) |
(No difference)
|
Revision as of 17:01, 28 July 2009
Description
Returns a single pixel img tag that sends data to Trigger Email Marketing via their API specification. The tag will automatically pull and use the clientid and client key as specified in Settings under the eCommerce tab. The tag will also automatically pull the email address using the orderGetEmail function for the passed order data array.
Syntax
$tag = eV::TEMChannelTag($channel_id[,$dataArr][,$environment=test])
Paramaters
- $channel_id CHAR REQUIRED
- specifies the channel id, as assigned by Trigger Email Marketing.
- $dataArr ARRAY OPTIONAL
- keyed array of customer facts, conversion facts, abandoned cart or cart item data. See the TEM API data specification for available fields.
- $environment CHAR OPTIONAL
- dropbox location as assigned by Trigger Email Marketing. Defaults to 'test'.
Return Values
Returns a string containing the complete image tag - ready to be echo'd to the screen. Example value:
<img src=”https://secure.triggeremails.com/public/api/test/tem_eboapi.php?c=123456&ck=567890&e=test@test.com&ch=1234” height=”0” width=”0” border=”0”>
Examples
- Newsletter Registration Example
// set the channel id // this is provided by TEM $channel_id = "12345"; // we also want to pass the first name // this is an optional customer fact $orderArr = eV::orderGetCompleteArray(); $firstName = eV::orderGetFirstName($orderArr); $dataArr = array('f_first_name' => $firstName); // place this within the body tag of the 'thank you' page following email registration. echo eV::TEMChannelTag($channel_id,$dataArr);
- Conversion tag following completed order
// set the channel id // this is provided by TEM $channel_id = "23456"; // we will need the order array to get necessary data to generate tag $orderArr = eV::orderGetCompleteArray(); // convert order data into data array that function is expecting $dataArr = eV::TEMDataArr_conversion($orderArr); // get tag $tag = eV::TEMChannelTag($channel_id,$dataArr); // output tag echo $tag;