This repository was archived by the owner on May 21, 2019. It is now read-only.
File tree 2 files changed +25
-11
lines changed
2 files changed +25
-11
lines changed Original file line number Diff line number Diff line change @@ -101,24 +101,31 @@ export default class App extends Component {
101
101
102
102
tracker . trackScreenView ( "Hello" ) ;
103
103
104
- /* GoogleTagManager.openContainerWithId("GT -NZT48")
104
+ GoogleTagManager . openContainerWithId ( "GTM -NZT48" )
105
105
. then ( ( ) => {
106
- return GoogleTagManager.stringForKey("pack");
106
+ return GoogleTagManager . registerFunctionCallTagHandler ( "awzm_tag" , ( fn , payload ) => {
107
+ console . log ( "test" , fn , payload )
108
+ } )
107
109
} )
108
- .then(str => {
109
- console.log("Str: ", str);
110
- return GoogleTagManager.boolForKey("wat");
110
+ . then ( ( ) => {
111
+ return GoogleTagManager . registerFunctionCallTagHandler ( "some_other_tag" , ( fn , payload ) => {
112
+ console . log ( "test2" , fn , payload )
113
+ } )
111
114
} )
112
- .then(wat => {
113
- console.log("Wat: ", wat);
114
- return GoogleTagManager.doubleForKey("orly");
115
+ . then ( reg => {
116
+ console . log ( "Push?: " , reg ) ;
117
+ return GoogleTagManager . pushDataLayerEvent ( {
118
+ event : "some_event" ,
119
+ id : 1
120
+ } ) ;
115
121
} )
116
- .then(orly => {
117
- console.log("Orly: ", orly);
122
+ . then ( db => {
123
+ console . log ( "db: " , db ) ;
124
+ return GoogleTagManager . doubleForKey ( "db" ) ;
118
125
} )
119
126
. catch ( err => {
120
127
console . log ( err ) ;
121
- });*/
128
+ } ) ;
122
129
123
130
return (
124
131
< View style = { styles . container } >
Original file line number Diff line number Diff line change @@ -352,4 +352,11 @@ export class GoogleTagManager {
352
352
* @returns {Promise<boolean> }
353
353
*/
354
354
static setVerboseLoggingEnabled ( enabled : boolean ) : Promise < boolean >
355
+
356
+ /**
357
+ * Register Function Call tag handler
358
+ * @param {String } functionName
359
+ * @param {Function } handler
360
+ */
361
+ static registerFunctionCallTagHandler ( functionName : string , handler : ( functionName : string , tagArguments : any ) => any ) : Promise < boolean >
355
362
}
You can’t perform that action at this time.
0 commit comments