Skip to content

Commit

Permalink
Added changed tracking code and configuration options for it
Browse files Browse the repository at this point in the history
  • Loading branch information
groganz committed Jul 10, 2016
1 parent 9847874 commit 3849535
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions administrator/configuration/cta.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,53 @@ GTM.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Independently from placing the tracking code diretly to the HTML source or using GTM,
here is how CampaignChain's JavaScript tracking code looks like:
here is how CampaignChain's default JavaScript tracking code looks like:

.. code-block:: html

<script type="text/javascript" src="[CAMPAIGNCHAIN INSTALLATION]/bundles/campaignchaincore/js/campaignchain/campaignchain_tracking.js"></script>
<script type="text/javascript" src="//[CAMPAIGNCHAIN INSTALLATION]/tracking.js"></script>
<script type="text/javascript">
var campaignchainChannel = '[CAMPAIGNCHAIN CHANNEL TRACKING ID]';
cc('[CAMPAIGNCHAIN CHANNEL TRACKING ID]');
</script>

Replace ``[CAMPAIGNCHAIN INSTALLATION]`` with the URL of the root of your CampaignChain
installation, e.g. *http://www.example.com/bundles/campaignchaincore/js/campaignchain/campaignchain_tracking.js*.
installation, e.g. *//campaignchain.example.com/tracking.js*.

.. note::
Make sure you Omit ``http`` or ``https``, so that the script can work
with either protocol.

Next, replace ``[CAMPAIGNCHAIN CHANNEL TRACKING ID]`` with the ID generated by
CampaignChain for your channel.

2.4 Anonymizing the Tracking Script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to hide from visitors to your CTA-tracked Channel, that you are
using CampaignChain or you want to custom brand the tracking code, then we have
configuration options for you in the *parameters.yml* file:

.. code-block:: yaml
campaignchain.tracking.id_name: 'cctid'
campaignchain.tracking.js_route: '/tracking.js'
campaignchain.tracking.js_class: 'CCTracking'
campaignchain.tracking.js_init: 'cc'
With *campaignchain.tracking.id_name*, you can define the name of the URL
parameter which CampaignChain attaches to links pointing to a connected channel.
Make sure the name you choose is short and as unique as possible, to avoid that
it collides with other parameters that might already be in the URL.

The URL of the tracking script itself can be changed with
*campaignchain.tracking.js_route*. There you defined the path aka URI to the
script relative to the base URL where CampaignChain is installed.

The name of the JavaScript class that appears inside the tracking script can
be customized with the *campaignchain.tracking.js_class* parameter.

Finally, *campaignchain.tracking.js_init* allows you to define the name of the
JavaScript function that is being called to pass the Channel ID in the tracking
code.

.. _GTM Web interface: https://tagmanager.google.com

0 comments on commit 3849535

Please sign in to comment.