Mobile App Implementation

 

Installing the SimpleReach tag on mobile apps is the equivalent of making an external HTTP request each time a content piece is loaded.

Please note if you already have a website implementation or other implementation attached to the same account, all content fields (marked here with a *) for a given article must match across implementations. See Multiple Implementations in our Implementation Best Practices for more information.

REQUIRED HEADERS 

USER AGENT (REQUIRED):

To decide whether traffic should be attributed to a mobile device, tablet, or even desktop (if that's your thing), we need to be sent the user agent. Setting the user agent string in the header of the HTTP request ensures that we give proper attribution to each referral. Be sure to set the string as something that is recognizable as either a mobile or tablet browser. If you are unsure of what this might be, use this list of user agent strings as reference.

REQUIRED PARAMETERS 

PID (REQUIRED):

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:

?pid=4fc608fea782f333ea0000fb

TITLE (REQUIRED)*:

The title of the content piece. If you have another implementation that is pulling in data for the same content piece, this field must match the other implementation's.

&title=30%20Entrepreneurs%20Under%20Thirty

URL (REQUIRED):

The canonical URL of the content piece.

&url=http%3A%2F%2Fwww.example.com%2Fentrepreneurship%2F30-entrepreneurs-under-thirty

DATE (REQUIRED)*:

Content publish date in UTC or any ISO8601 date. The date value must be Javascript parsable. If you have another implementation that is pulling in data for the same content piece, this field must match the other implementation's.

&date=2014-08-25%2014%3A15%3A19

One way of checking this is to open up the JavaScript console in a browser and check the non URL encoded date:

new Date(Date.parse(__reach_config.date));

If the console returns the content piece's publication date, then the date is parsable by JavaScript.

PAGE_URL (REQUIRED)

This is the content piece's URL.

REF_URL (REQUIRED)

The domain of the referring network with the protocol (http or https) included. If your application uses Facebook or Twitter as a proxy and pulls URLs from those networks, you can pass in one of the domains to this field so we can give proper attribution. If your application does not use another platform as a proxy, we recommend setting this field to the domain of the associated website so that we can properly attribute the referrals as 'Internal'.

ref_url=https%3A%2F%2Fwww.facebook.com

DOMAIN (CONDITIONALLY REQUIRED):

The full domain of the site. If your app 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).

?domain=custom.simplereach.com

USER_ID (CONDITIONALLY REQUIRED):

Parameter to provide a unique user id to track unique users across browsers and devices. If your app does not have cookies enabled, this field is required for us in order to track unique user counts accurately. However, if your app has cookies enabled, this field is not required. This value can be anything and is usually the ID for the user from the publisher's login. 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.

AUTHORS (RECOMMENDED)*:

A pipe-separated list of authors. If you have another implementation that is pulling in data for the same content piece, this field must match the other implementation's.

Example of single author:

&authors=eric

Example of multiple Authors

&authors=John%20Steinbeck%7CJane%20Austen

CHANNELS (RECOMMENDED)*:

A pipe-separated list of content piece channel or channels. Channels typically represent sub-sites of your main site, and are represented as “categories” in our tool. If you have another implementation that is pulling in data for the same content piece, this field must match the other implementation's.

&channels=News%7CSports%7CFootball

TAGS (RECOMMENDED)*:

A pipe-separated list of the content piece's tags, such as those that might appear at the bottom of the content piece to describe its content in more detail. If you have another implementation that is pulling in data for the same content piece, this field must match the other implementation's.

&tags=content%20marketing%7Csponsored

EXAMPLE 

Sending an event to SimpleReach is done with an HTTP request. Here is an example HTTP request being sent:

http://edge.simplereach.com/n?pid=305dadd3400e7d3f32002002&url=http%3A%2F%2Fwww.example.com
%2Fsimplereach-examples&title=Test%20Title&date=2014-01-11&domain=thecoolist.com&ref_url=
&referrer=&page_url=http%3A%2F%2Fwww.example.com%2Fsimplereach-examples&authors=344%7Cdr.
%20author&channels=&tags=5344%7Cexample%20tag

CAVEATS 

Call backs: the way the Javascript code is structured, if a call back is passed then the response object will be JSONP. If no call back is passed then the response object will be JSON.

.