ianhampton / angulartics-tealium

Tealium Angulartics module
2 stars 0 forks source link

How do I use angulartics-tealium #1

Open tw-louie opened 8 years ago

tw-louie commented 8 years ago

Hello,

I want to use the module you have made but am unsure how to import it. If I had the following code would I have to remove angulartics and angulartics.google.tagmanager in lieu of angulartics.tealium?

import angular from 'angular'
import 'angulartics'
import 'angular-ui-bootstrap'
import 'angular-ui-router'
import appointmentConfirmation from './appointment_confirmation/appointmentConfirmation.module'
import demographics from './demographics/demographics.module'
import error from './error/error.module'
import filters from './filters/filters.module'
import timeslots from './timeslots/timeslots.module'
import { environment } from './environment'

let app = angular.module('Retail', [
  // Angular modules
  'ui.bootstrap',
  'ui.router',
  // Angulartics
  'angulartics',
  'angulartics.google.tagmanager',
  // Our modules
  appointmentConfirmation.name,
  demographics.name,
  error.name,
  filters.name,
  timeslots.name
]).constant('environment', environment)

Cheers, prov-louie

ianhampton commented 8 years ago

Hi,

Make sure you've placed the angulartics-tealium.js file in the src folder and loaded it in your app (see the example in the samples folder). Then replace angulartics.google.tagmanager with angulartics.tealium, or just add it if you want to continue using GTM.

Hope that helps.

Ian

AbsoLouie commented 8 years ago

Hey Ian,

Thanks for the information. I wanted to let you know that we had issues using the pageTrack method. In the end we had to modify the module on line 58 from:

window.utag.view(utag_data); to window.utag.view(utag_data.page_path);

So that the correct arguments would be sent to utag.view. Is this a good way to handle this issue?

Cheers, Louie