Analytics in Optimizely Content Marketing Platform (CMP) are content-centric, which means that they can provide granular, meaningful insights from your content in a way that typical site analytics cannot, offering more visibility and better data so you can make the best decisions for your content marketing strategy.
Add a small script in the header of your article pages. Optimizely tracks engagement for each page containing content, which includes any format.
Copy the snippet and install it to your site in one of the following ways:
Add the snippet via a CMS
Log into your CMS and access your site’s HTML code. Paste your snippet (unaltered and in its entirety) into the site header immediately before the closing </head> tag.
Some CMS’s have a separate section where you can add a tracking code. If you are unsure of your site's specific configuration, contact your web production or development team. Contact Support if you have any questions or require additional assistance.
Add the snippet via WordPress
There are two easy ways to add the tracking code to WordPress:
- Option 1: Plugins (Recommended). There are a variety of plug-ins available to add custom header and footer codes to your site. A simple, light-weight plug-in that you should use is Insert Headers and Footers. Paste your tracking code snippet into the header on the plugin's settings page.
- Option 2: Paste directly into the header. Open up the editor for the header.php file. Paste the snippet right before the closing </head> tag.
Add the snippet via Google Tag Manager
Follow these instructions only if you already have a working configuration of Google Tag Manager (GTM) on your website. This means you have copied and pasted your GTM’s code snippets into your website as instructed in the Install Tag Manager dialog box. See instructions on Google’s Support site.
- From your GTM container, click New.
- Give your new tag a name and set Tag Type to Custom HTML.
- In the HTML field, paste your unique analytics snippet (including the opening and closing <script> tags).
- In the Triggering section at the bottom, add a Firing Trigger for All Pages.
- Click Save.
- Click Submit on the main workspace page to push the tag (Welcome JS).
- Include Version Name and Description and click Publish to complete.
Will this impact the performance of my site?
What is a tracking pixel?
A tracking pixel is a code that uses a single pixel to track different user engagements through an HTML img tag. The code is inserted into the pages of third-party websites right below the article's description. The pixel activates a request when a visitor loads the page and the request is logged as a page view.
Why does CMP use tracking pixels?
The tracking pixel collects data by activating when the page loads. It can count pageviews and unique visitors. The following example shows the tracking pixel:
<img src="https://pixel.welcomesoftware.com/px.gif?key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==" alt="" height="1" width="1" class="nc_pixel"/>
Tracking pixels vary by URL. You can see them from any tasks that are also opened from the "Tasks" section.
Go to any of your tasks, open the options menu (...) > More > Copy Tracking Pixel to copy it onto your clipboard.
How do I know if the tracking pixel is working?
If the tracker is working, it will show a 200 status. To find this, go to your article page on your website (it must be published through the CMP), right click your mouse and inspect the page in developer mode. It will look similar to the following image.
After opening the developer's tool, reload the page by pressing F5. As you can see in the image above, open the Network tab and search for pixel. If you see 200 in the Status column, then the tracking code is working correctly. If you want more details, search for tracker and click on it.