How to create sessions and page views variables in DTM custom JS section?



I want to set a condition in DTM on Session and Pageviews, how can we create these variables in this.

Also, could anyone share the default variables, functions and methods?

Thanks in Advance!

Accepted Solutions (0)

Answers (4)

Answers (4)




As long as you are counting page views on each of those pages, you can get your answer in analytics.  In your case, you have a dimension (page name) and a metric (page views).  You may be able to get your answer directly from a page names report if you can easily filter based on the text of the page name.  If not, read on.

If you want a count of content versus non-content page views, you have a couple choices:

1) Create a classification (in Analytics) of page name (essentially a lookup table that says whether each page name is "content" or "non-content".  This can be done via a file upload (using SAINT) or using the classification rule builder in AA admin,

2) Add a new s.prop in DTM that will capture page type (content / non-content / other).  You can then use this variable as your dimension in reporting. You could even do a breakdown report of this dimension by pageviews if you wanted to know which non-content pages are getting the most traffic.

3) You could set an event (a counter) on each non-content page (in DTM) if all you want is a count of non-content pages.




Let me re-phrase your question to make sure that I understand it correctly.

You want to know how to use DTM with Adobe Analytics to set the "sessions" and "page views" metrics.

If this is correct, then here is your answer -

First and foremost, you need to install the Adobe Analytics tool in DTM.  This is done from the Overview tab for the property.

You'll need to configure your Adobe Analytics tool, setting up (at a minimum) your tracking server and your report suites.

Screen Shot 2018-06-11 at 9.06.36 AM.png

Assuming that you've done this part, read on.

Counting Sessions :

A session is automatically created upon sending any beacon to Adobe Analytics.  A session is automatically ended upon 30+ minutes of inactivity (30 minutes without a beacon).

Counting Pageviews :

Page Views are automatically counted when a page view beacon is sent (this is the s.t() beacon).  This happens automatically in DTM when the _satellite.pageBottom() tag is executed (assuming that the Adobe Analytics Tool is configured for the DTM property).  It also happens when you select s.t() under Tracking in the Adobe Analytics section of an event or direct call rule (when that rule fires).

Screen Shot 2018-06-11 at 9.04.52 AM.png



Thanks for you reply, my question was if I want to set any condition on session base like, in single session how many times users visits to my Thread page so that i can increase counter on that base.

  • Non-Content case
    user visits Home Page, Category page, News page, Thread page, 2nd Thread page type and 3rd Thread page type. 
    Adobe Analytics captures the total number of non-content pages viewed as "3".

I am new in DTM might be i thinking in a wrong way, please correct me.