Measurement: Tagging on site events

XtremePush has three methods for tagging activity on your site one for tagging page impression, one for tagging any other events for analytics and one for tracking realtime events to trigger On-Site Messages if needed.


Capturing User ID

For Apps with a sign in linking web information to a user profile is a hugely valuable step. This turns web analytics into customer analytics and allows communications to be personalised and targeted based on customer insights.

// set user id to sync with your CRM or backend system
xtremepush('set', 'external_id','YOURUSERSID');

Setting User language

You can set user language to match their site preferences using below

// set user language to sync with user prefs, using ISO 639-1 alpha-2 code
xtremepush('set', 'app_language','en');

Counting Page Impressions

To count page impressions call the impression method where your page loads:

// Send impression to track page impressions
xtremepush('impression', 'sport.home');

The tag used to record a page impression should uniquely identify a page. 



Measure on site Events with tags

To tag events for analytics and the ability to segment campaigns based on tag behaviour call the tag method where that event occurs as shown:


// You might for example want to tag a registration event
xtremepush('tag', 'registration.complete');

To tag events that capture a value and grab the value, use the hitTag method with the value option, for example:

// You might for example want to capture a field value from a form being filled out
xtremepush('tag', 'journeyform.destination', 'New York');


Capture User Attributes

To capture user attributes you can use the following "user.attribute" syntax:

// You might for example want to capture the gender of a registered user
xtremepush('tag', 'user.gender', 'Male');

// or capture a user preference
xtremepush('tag', 'user.subscribed.sportnews', 'true');

Tracking Metrics like revenue with tags

If you have metrics like revenue, reward points, air miles, kilo-metres run, numbers of transactions. money deposited etc. in your App you can easily track them with xtremepush. To capture metrics you can use the following "#METRICNAME: TAGNAME" syntax:


// Metric Syntax is as follows, and you can send any available metric
xtremepush('tag', '#METRIC_NAME: TAG_NAME', 'AMOUNT');
//like an amount of revenue related to a purchase
xtremepush('tag', '#revenue: new-suit.purchased', 200);
//like an amount of revenue related to a purchase
xtremepush('tag', '#air-miles: flight.Lon-NY', 1200);


Adding Trigger Events for Notification and on Site Messages 

Trigger events can be added to your site very simply using the event method of the xtremepush web SDK. 

xtremepush('event', 'EVENT_NAME');

These can also include values similar to tags:

xtremepush('event', 'EVENT_NAME', 'EVENT_VALUE');


For more detail on events and how the can easily be added using a tag manager product like GTM see the following article:


There is also more info on using events to trigger campaigns in the docs: 




Have more questions? Submit a request


Article is closed for comments.