{"_id":"542aee7d54d88d140075ff00","category":{"_id":"5429898d1215fe08007e0fe6","pages":["5429ad872e366c080086b5c6","5429cb1b2e366c080086b777","542db0adcb19820800c1f4a3","54380c2df15a8e1400831f88","542aee7d54d88d140075ff00","542af02f54d88d140075ff14","542f14abacabcf080095953b","54651c6df42a472000b0c611","55f81b4f59eace0d0087db2b","56b0c5d81486990d009c101a","56babbffc275570d00ce7105"],"project":"542979c51215fe08007e0ee5","version":"542979c51215fe08007e0ee8","__v":10,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-29T16:32:13.661Z","from_sync":false,"order":1,"slug":"helpers","title":"Helpers"},"parentDoc":null,"project":"542979c51215fe08007e0ee5","user":"542979b61215fe08007e0ee4","__v":5,"is_link":false,"version":{"_id":"542979c51215fe08007e0ee8","project":"542979c51215fe08007e0ee5","__v":4,"createdAt":"2014-09-29T15:24:53.437Z","releaseDate":"2014-09-29T15:24:53.437Z","categories":["542979c51215fe08007e0ee9","542985897a6b690800767fab","5429898d1215fe08007e0fe6","542ac5aa54d88d140075fcaf"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-09-30T17:55:09.085Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"settings":"","try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":7,"body":"The `{litmus}` helper makes it easy to insert the [Litmus](http://litmus.com) analytics tracking code into your production email.\n\n## Usage\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{litmus id=\\\"[TRACKING ID HERE, OPTIONAL]\\\" merge_tag=\\\"[MERGE TAG HERE]\\\"}\",\n      \"language\": \"html\",\n      \"name\": \"email.html\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"This helper only adds HTML to your email in a production build.  In all other environments it is ignored - ensuring that recipients of your preview builds don't inadvertently trigger tracking events.\",\n  \"title\": \"Note!\"\n}\n[/block]\n## Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`id`\",\n    \"h-0\": \"key\",\n    \"h-1\": \"description\",\n    \"h-2\": \"description\",\n    \"0-1\": \"The unique tracking ID provided to you from Litmus when you created your new tracking code. Optional.\",\n    \"0-2\": \"\",\n    \"1-0\": \"`merge_tag`\",\n    \"1-1\": \"Your ESP's merge tag used to identify the recipient's email address.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n## Automatic Report ID Generation\n\nDuring production build generation, when Inkcite encounters the `{litmus}` tag that does not define an `id`, it will request one from Litmus automatically - and store it for future builds of the same email.\n\nTo automatically request analytics ID from Litmus, you must first define the `litmus` section of the `config.yml` file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"# Litmus integration for automatic analytics ID assignment\\n# and injection into production email HTML.\\n# http://litmusapp.com\\nlitmus:\\n  subdomain: '(YOUR LITMUS SUBDOMAIN HERE)'\\n  username: '(YOUR LITMUS USERNAME HERE)'\\n  password: '(YOUR LITMUS PASSWORD HERE)'\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note!\",\n  \"body\": \"Inkcite uses encryption when communicating with the Litmus API.  Your user ID and password are used for no other purpose than generating new compatibility previews.\"\n}\n[/block]\nOnce this section is added to your `config.yml` file, the next time you run `inkcite build` it will automatically request a new analytics report ID for each version of your email.  Repeated runs of `inkcite build` will re-use the same analytics ID previously requested.","excerpt":"Add engagement, device and geo-location reporting to your production email","slug":"litmus-analytics","type":"basic","title":"Litmus Analytics"}

Litmus Analytics

Add engagement, device and geo-location reporting to your production email

The `{litmus}` helper makes it easy to insert the [Litmus](http://litmus.com) analytics tracking code into your production email. ## Usage [block:code] { "codes": [ { "code": "{litmus id=\"[TRACKING ID HERE, OPTIONAL]\" merge_tag=\"[MERGE TAG HERE]\"}", "language": "html", "name": "email.html" } ] } [/block] [block:callout] { "type": "info", "body": "This helper only adds HTML to your email in a production build. In all other environments it is ignored - ensuring that recipients of your preview builds don't inadvertently trigger tracking events.", "title": "Note!" } [/block] ## Parameters [block:parameters] { "data": { "0-0": "`id`", "h-0": "key", "h-1": "description", "h-2": "description", "0-1": "The unique tracking ID provided to you from Litmus when you created your new tracking code. Optional.", "0-2": "", "1-0": "`merge_tag`", "1-1": "Your ESP's merge tag used to identify the recipient's email address." }, "cols": 2, "rows": 2 } [/block] ## Automatic Report ID Generation During production build generation, when Inkcite encounters the `{litmus}` tag that does not define an `id`, it will request one from Litmus automatically - and store it for future builds of the same email. To automatically request analytics ID from Litmus, you must first define the `litmus` section of the `config.yml` file: [block:code] { "codes": [ { "code": "# Litmus integration for automatic analytics ID assignment\n# and injection into production email HTML.\n# http://litmusapp.com\nlitmus:\n subdomain: '(YOUR LITMUS SUBDOMAIN HERE)'\n username: '(YOUR LITMUS USERNAME HERE)'\n password: '(YOUR LITMUS PASSWORD HERE)'", "language": "text" } ] } [/block] [block:callout] { "type": "info", "title": "Note!", "body": "Inkcite uses encryption when communicating with the Litmus API. Your user ID and password are used for no other purpose than generating new compatibility previews." } [/block] Once this section is added to your `config.yml` file, the next time you run `inkcite build` it will automatically request a new analytics report ID for each version of your email. Repeated runs of `inkcite build` will re-use the same analytics ID previously requested.