Standard implementation is the most common type of implementation, and is loosely defined as the method you would use on pages where the content changes when the URL changes. Install the code below on your article page template or any content page that you want tracked. The parameters (i.e. pid, title, url, etc.) should be passed up by the CMS in the format mentioned below.
Got a mobile site? For complete coverage, be sure to add the SimpleReach code to your mobile templates as well.
Please note if you have or are planning to attach another implementation to the same account, for example, a mobile app implementation, all content fields (marked here with a *) for a given piece of content must match across all implementations. See Multiple Implementations in our Implementation Best Practices for more information.
Add the following code to your site with your chosen values in place of the values preceded by a $(dollar) sign:
(Note: The dollar signs in the code example below are not part of the syntax, they are simply a part of the placeholder values. Please do not include the dollar signs in your code.)
This is the SimpleReach-assigned Publisher ID (PID) that you should have received by email. Your PID is a 24-character alphanumeric string that looks similar to: 4fc608fea782f333ea0000fb. If you don't have your PID yet, send us an email and we'll make sure you have one.
In your final implementation code, your PID will look something like this:
If you’d like to use a test PID to check if your code is implemented correctly before pushing it to your entire site, check out our documentation on testing.
We support automatic URL detection if your site headers contain Facebook Open Graph tags (specifically 'og:url') or canonical URL meta tags in this format:
<link rel="canonical" href="http://www.website.com/categories/article1.html" />
If your site contains either of these tags in its header, you do not need to include the 'url' field—it will populate automatically.
There are many reasons why you'd want to include the rel=canonical meta tag in your headers. Click here to read more about it!
If your site headers do not contain these tags, you will need to include the canonical URL in this field, which is the canonical or permanent URL of the content. This is the URL that a user would enter in a browser to visit the page directly and should not include the protocol unless this changes the content being rendered. Trailing slashes should also be consistent. Be sure that the URL is stripped of any query parameters that may be included. So, if a user navigates to:
That 'url' field should populate with:
Since this is how we identify unique pieces of content and create dashboards, it's important that the URL in the 'url' field for a given piece of content always be exactly the same, regardless of any query parameters that may be appended to the URL that the user used to arrive there. Example:
Content publish date in UTC or any ISO8601 date.
date: '2014-10-30 15:00:06'
The title of the content piece.
title: 'How To Use StumbleUpon As A Secret Weapon'
DOMAIN (CONDITIONALLY REQUIRED):
The full domain of the site. If your site uses custom domains, this field should be set to allow us to whitelist the custom domains and aggregate data under your account. For example, if you have a custom domain of 'custom.simplereach.com', you should pass us 'custom.simplereach.com' for this field. This should not include the protocol (http).
An array containing the content piece's author or authors.
Example of single author:
authors: ['Alexis Krantz']
Example of multiple authors:
authors: ['Alexis Krantz', 'Joe Smith', 'Kent Brockman']
An array that includes the content piece's channel or channels. Channels typically represent sub-sites of your main site, and are represented as “categories” in our tool.
channels: ['health', 'beauty']
An array containing the content piece's tag or tags, such as those that might appear at the bottom of the content piece to describe its content in more detail.
tags: ['content analytics', 'content marketing', 'publishers']
Most implementations will not require these, but if you think you need them, please feel free to email us and ask.
Prior to implementing article_id for your content, we highly recommend reading our Article Metrics section.
The article_id parameter is used (optionally) to group and identify several pieces of content on different URLs as one “Article” in our Dashboard. These content items, once grouped, will enable an additional “Article” level set of metrics that combines (or “rolls-up”) the data from the individual content items.
The article_id field can be set as a string or integer of your choice. For example, when using a string, the article_id setting would be similar to:
article_id: ‘AB Test 5388SD7000001’
And alternatively, if using an integer, the configuration would be set as:
If you do not add in the article_id field to the __reach_config, it will default to the content’s content_id in our system.
Optional parameter to provide a unique user id to track unique users across browsers and devices. This value can be anything and is usually the ID for the user from the publisher's login. If you do NOT have a method of providing your own unique user ID in this field, please do not include it in the __reach_config object. Each unique user_id is counted as a unique user in our system, so if this is not populated properly, we will not be able to correctly count unique users in our tool. If you do not include the user_id field, we will calculate unique users via our own methods.
If you choose not to employ an optional parameter, be aware of their default values.